# Neural Networks and Deep Learning

> Neural networks power deep learning, from LSTMs to transformers. Learn how they work, where they help in trading, especially with text and images, and their risks.

Source: https://learn.tradelabsai.com/machine-learning/neural-networks/  
Track: Machine Learning · Level: Advanced · Updated: 2026-10-03  
Publisher: TradeLabs AI (https://tradelabsai.com). Education, not financial advice.  
Cite as: TradeLabs Learn, "Neural Networks and Deep Learning", https://learn.tradelabsai.com/machine-learning/neural-networks/

Neural networks are models built from layers of simple units that each combine their inputs with learned weights and pass the result through a non linear function. Stacked deeply, they can learn very complex patterns, and they drive modern breakthroughs in image recognition, speech and language models. In trading, neural networks are valuable for unstructured data such as news text, filings and images, and they are used by many large firms. For predicting prices from price history alone, though, they often perform no better than simpler models while being much easier to overfit.

## How a neural network learns

1. **Input layer:** receives features, such as recent returns or word embeddings.
2. **Hidden layers:** each unit computes a weighted sum of its inputs and applies an activation function.
3. **Output layer:** produces a prediction, such as a probability or a number.
4. **Training:** the network compares predictions with true values and adjusts weights through backpropagation and gradient descent to reduce error.

## Types of networks

| Type | Designed for | Trading use |
|---|---|---|
| Feedforward (multilayer perceptron) | Fixed sets of features | Combining tabular signals |
| Convolutional (CNN) | Spatial patterns | Satellite images, chart images, order book snapshots |
| Recurrent (RNN, LSTM, GRU) | Sequences | Time series of prices or events |
| Transformers | Long sequences with attention | Language models for news and filings; some time series work |
| Autoencoders | Compressing data | Anomaly detection, latent factors |

## Where neural networks help most

| Use | Why |
|---|---|
| Text and sentiment | Language models understand context far better than word counts. See [Social and News Sentiment](https://learn.tradelabsai.com/alternative-data/social-and-news-sentiment/) |
| Earnings calls and filings | Extracting tone, uncertainty and topics. See [Earnings Calls](https://learn.tradelabsai.com/fundamentals/earnings-calls/) |
| Alternative data | Images, receipts, web data. See [Alternative Data Explained](https://learn.tradelabsai.com/alternative-data/alternative-data-explained/) |
| Limit order book modelling | Short term prediction from rich, high volume data |
| Volatility surfaces and derivatives pricing | Fast approximations of complex pricing models |

**Example: Text beats price for a neural network**
A researcher trains an LSTM on five years of daily returns for 50 stocks to predict next day direction. Out of sample accuracy is 50.4%, indistinguishable from chance after costs. The same researcher uses a pretrained language model to score the tone of overnight news headlines for those stocks and feeds the scores, along with simple price features, into a gradient boosted model. Out of sample, stocks in the most positive news group outperform the most negative group modestly the next day before costs. The neural network added value where the data was rich and unstructured, not on noisy price series alone. Results like this vary and must be tested carefully. See [Combining Signals](https://learn.tradelabsai.com/research/combining-signals/).

## Why deep learning struggles on price data

- **Little data:** daily prices give only a few thousand points per asset; deep networks often need far more.
- **Low signal to noise:** networks readily fit noise.
- **Non stationarity:** patterns change faster than models can learn them. See [Stationarity, Differencing and Unit Roots](https://learn.tradelabsai.com/math/stationarity/).
- **Many settings to tune,** each one another chance to overfit. See [P-Hacking and Multiple Testing](https://learn.tradelabsai.com/research/p-hacking-and-multiple-testing/).

## Making them work better

1. **Use pretrained models** for text and images rather than training from scratch.
2. **Regularise heavily:** dropout, weight decay, early stopping and small networks.
3. **Use more data** where possible: many assets, intraday data, ensembles.
4. **Validate by time** with walk forward tests. See [Walk-Forward Validation and Preventing Overfitting](https://learn.tradelabsai.com/machine-learning/walk-forward-validation/).
5. **Compare with simple baselines** such as linear models and gradient boosting. Keep the network only if it clearly wins out of sample.

## Interpretability

Neural networks are harder to explain than linear models or trees. Tools such as SHAP values and attention maps help, but in regulated settings firms may prefer simpler models where decisions must be justified. See [Operational and Model Risk](https://learn.tradelabsai.com/portfolio/operational-and-model-risk/).

## Frequently asked questions

### Do neural networks work for stock prediction?

They are most useful with rich, unstructured data such as text and images; on price history alone they often perform no better than simpler models.

### What is an LSTM in trading?

A type of recurrent neural network designed to learn from sequences, often tried for time series, though results on prices alone are usually modest.

### Should beginners use deep learning for trading?

It is better to start with simple models and sound validation; deep learning adds complexity and overfitting risk that is hard to manage without experience.

Next, learn which inputs give models a chance in [Feature Engineering](https://learn.tradelabsai.com/machine-learning/feature-engineering/).

## Continue learning

- Next lesson: [Feature Engineering](https://learn.tradelabsai.com/machine-learning/feature-engineering/)
- Previous lesson: [Random Forests and Gradient Boosting](https://learn.tradelabsai.com/machine-learning/random-forests/)
- Related: [Random Forests and Gradient Boosting](https://learn.tradelabsai.com/machine-learning/random-forests/): Random forests and gradient boosted trees are strong models for tabular trading data. Learn how they work, key settings, feature importance and overfitting risks.
- Related: [Machine Learning in Trading](https://learn.tradelabsai.com/machine-learning/machine-learning-in-trading/): An honest guide to machine learning in trading: where it helps, why it often fails on market data, the main model types and a sound workflow for using it safely.
- Related: [Social and News Sentiment](https://learn.tradelabsai.com/alternative-data/social-and-news-sentiment/): Text analysis turns news and social media into sentiment signals. Learn how sentiment is measured, from word lists to language models, the evidence and the pitfalls.
- Related: [Alternative Data Explained](https://learn.tradelabsai.com/alternative-data/alternative-data-explained/): Alternative data is non traditional information like card spending, web traffic and satellite images. Learn the main types, how funds use it and the risks.
- Related: [Overfitting and Curve Fitting](https://learn.tradelabsai.com/research/overfitting-and-curve-fitting/): Overfitting means a strategy fits noise instead of a real pattern. Learn the warning signs, why it happens, how to measure it and practical ways to avoid it.
