본문으로 건너뛰기
L3.8

Why Long Context Is Hard

About 24 min

Goal

By the end of this lesson, you can calculate how repeated multipliers change distant influence and explain vanishing/exploding chains as a reason long dependencies can be hard to learn or use.

Repeated small losses of influence become large​

Suppose a toy recurrent path keeps 80% of an earlier signal at each step.

After one step, influence is:

0.8

After two:

0.8² = 0.64

After five:

0.8⁵ ≈ 0.33

After ten:

0.8¹⁰ ≈ 0.11

The earlier input was processed, but its direct influence has become much smaller after many repeated transformations.

That makes an important distinction:

A model having seen an earlier item does not guarantee that item still strongly affects a distant prediction.

Multipliers above one create the opposite problem​

With a repeated factor 1.5:

1.5² = 2.25

1.5⁵ ≈ 7.59

Repeated amplification can make signals or gradients grow rapidly.

These toy products illustrate two classic chain problems:

  • factors below one can create vanishing influence/gradients;
  • factors above one can create exploding influence/gradients.

Real recurrent networks contain nonlinearities and matrices, but the repeated-product intuition remains useful.

This affects both memory and learning​

The forward hidden state may gradually lose evidence from an early input. During training, gradients also travel through a long chain of recurrent transformations. They can shrink or grow, making it difficult to learn which distant event mattered.

This is the problem evidence we want before introducing a fix. A simple recurrent chain can make distant information and training signals progressively weaker or stronger just because they pass through many repeated transformations.

In the next lesson, LSTM and GRU will add learned gates and a more direct memory path. Those designs reduce this pressure, but they still keep a recurrent step-by-step dependency chain.

Measure influence by distance​

The Lab computes r^distance for several recurrent multipliers.

  1. Before running the Lab, find multiplier = 1.05 and threshold = 2.0.
  2. Predict after how many steps the repeated influence first becomes more than 2× its original magnitude.
  3. Click Run and check first distance above 2.0x: 15.
  4. Compare influence at short and long distances for r=0.5 and r=0.8.
  5. Change only multiplier to 1.10. Predict whether the threshold will be crossed earlier or later.
  6. Run again and compare the new crossing distance with 15.
  7. Reset the starter afterward.

Loading lab…

Aggregate accuracy can hide a distance problem​

Suppose a sequence model performs:

  • 95% when relevant context is 1–3 positions away;
  • 90% at 4–8 positions;
  • 55% at 20+ positions.

One overall average can hide the sharp long-distance weakness.

A useful failure slice therefore records performance by context distance.

This is a general evaluation habit: slice by the variable connected to your hypothesis.

What should a better memory path change?​

The measurement suggests what a useful recurrent fix should try to improve. Important information should not have to survive only through the same kind of repeated state rewrite at every step.

A better design should make it easier to:

  • preserve useful information across many steps;
  • decide when new input should replace or update old information;
  • keep training signals from depending only on a long chain of repeatedly shrinking or growing transformations.

Those requirements do not prove that any one architecture solves long dependencies. In the next lesson, you will inspect how LSTM and GRU add learned gates and a more direct memory path, then test what limitations still remain.

Quick Check

1. Why can distant influence fade?
2. What can repeated factors above one cause?
3. How can you expose long-context weakness?

0 of 3 questions answered.

Key Takeaways

  • Distant influence passes through repeated transformations.
  • Repeated factors below one can vanish; factors above one can explode.
  • “Seen in context” is not the same as “strongly influences the output.”
  • Evaluate sequence failures by context distance when distance is the suspected cause.
  • A better memory path can reduce repeated shrinking or growth, but it does not create perfect or unlimited memory.

Next Lesson

Next, L3.9 — LSTM and Gated Memory adds learned keep/write/read controls and a more direct memory path to address the recurrent-chain problem you just measured.

References

Lesson actions

Completion is stored locally on this device.

View progress