If I have a portfolio consisting of weights -12,11,3,-2,5,-5, I know that negative weights correspond to shorting but what do these large weights represent? I thought the weights are the proportion of your portfolio invested into each stock. Is it to do with leverage? Can I convert these weights to percentage weights close to 1?
I assume you found these weights by Markowitz Optimization? It is quite common that MVO will deliver extreme weights with some weights well above 100 percent (implying leverage, i.e. buying the stock on borrowed money) and others massively negative meaning a leveraged short position. These weights are not usable in a real portfolio.
Let's examine the first two weights more specifically -12, 11. It is very common for extreme weights to come in pairs like this. Because of the expected returns you input, the algorithm believes that asset 2 has significantly better return than asset 1, even though they are very similar in terms of risk. Therefore the algorithm has decided to take advantage of what it sees as a near arbitrage opportunity by "shorting the F... out of asset 1" (shorting 12 dollars for every 1 dollar you have under management) and using the proceeds to buy a massive long position in asset 2. It is nonsense of course, both in the sense that the position is not achievable with stocks under current margin rules, but also it makes no sense at all from an investment point of view.
This problem is well known, it has resulted in a lot of criticism of Markowitz Optimization over the years, limiting its practical use. What are some remedies?
The main thing is that the Expected Returns you input must be very carefully reviewed. Beware of any extreme differences, if you tell the algorithm that asset 2 is twice as good in terms of return as asset 1 it is going to jump on this wonderful fact and propose the kind of stupid position you got. Some people feed the algorithm equal returns (the minimum variance approach), others do allow differences but only very small differences, a stock that you like might be given a few basis points more returns than a stock you don't like. This is to avoid the kind of extreme sensitivity to expected value inputs that we see. The worst way to select expected returns is to simply use the actual historical returns over the recent past, the past returns are far more extreme than the expected returns going forward and are unsuitable as forecasts (stock price changes don't repeat the past).
You can also require that all weights be positive (no shorting). Unable to short, the algorithm will usually simply avoid "bad stocks" and the resulting portfolio will be better behaved.
There are other methods of "regularization" (such as upper and lower bounds on individual weights) and there are also other portfolio selection methods such as Black Litterman that attempt to avoid this problem from the get go.
Since the problem is one of "garbage in, garbage out" I do not recommend massaging the weights ex-post to make them more reasonable. Rather you should take a step back and rethink your expected return inputs.
Generally weights larger than 1 do correspond to leverage https://www.investopedia.com/terms/1/130-30_strategy.asp
Without knowing the context, my guess is that those numbers don't represent the total portfolio weights and are instead just a mathematical weight in which case yes, you can convert them.
You could break out the long and short components so that they each add up to 1.
(-12, -2, -5) => (-0.63, -0.11, -0.26)
(11, 3, 5) => (0.58, 0.16, 0.26)
Then you can scale them as desired if you wanted a 130% long and 30% short portfolio for example.