Well this is actually a very simple question.
Suppose of run a Fama-French 3-factor model regression on a portfolio $i$:
$$
r_{i,t} - r_f = \alpha_i + \beta_{i,mkt} (r_{mkt} - r_f) + \beta_{i,HML}HML_t + \beta_{i,SMB} SMB_t + \epsilon_{i,t}$$
You got some coefficients $\beta$. Now suppose you want to replicate return as close as possible the return of portfolio $i$ using only the factors.
To replicate the portfolio $p$ return, you need to hold a portfolio that has the following weights:
- Risk-free: $1-\beta_{i,mkt}$
- Market: $\beta_{i,mkt}$
- HML: $\beta_{i,HML}$
- SMB: $\beta_{i,SMB}$
This is the best you can do to replicate the return of portfolio $p$. In particular your replicating portfolio will have a correlation with portfolio $p$ of $\sqrt{R^2}$ where $R^2$ is the R-square of the regression.
In other words:
- You have a weight of $\beta_{i,mkt}$ on the market portfolio.
- A weight of $\beta_{i,SMB}$ in small caps and a weight of $-\beta_{i,SMB}$ in large-caps.
- A weight of $\beta_{i,HML}$ in value firms and weight of $-\beta_{i,HML}$ in growth firms.
As you can see if $\beta_{i,SMB}>0$ you are long small caps and short large-caps. If $\beta_{i,SMB}<0$ you are short small caps and long large caps.