atlas

Research map / Architectures and efficiency / Attention and transformers

What Can Transformer Learn with Varying Depth? Case Studies on Sequence Learning Tasks

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Transformer expressivity and learnability · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Designs four sequence learning tasks (classification, in-context QA, template matching, in-context template matching) and uses theory plus synthetic experiments to show how many attention layers each requires in attention-only transformers.

Problem

Understanding the minimum number of attention layers an attention-only transformer needs to perform memorization, reasoning, generalization, and contextual generalization on sequence tasks.

Approach

Introduces a family of interconnected sequence tasks of increasing difficulty and proves that one attention layer suffices for memorization but not reasoning or generalization, two layers suffice for reasoning and generalization via copy-matching and parse-mapping, and three layers are constructed for contextual generalization (parsing-copying-matching).

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use one attention layer for sequence classificationAttention-only transformer · Sequence classificationaccuracyHelped
use one attention layer instead of twoAttention-only transformer · In-context question answeringaccuracyHurt
use two attention layers instead of oneAttention-only transformer · In-context question answeringaccuracyHelped
use one attention layer instead of twoAttention-only transformer · Template matchingaccuracyHurt
use two attention layers instead of oneAttention-only transformer · Template matchingaccuracyHelped
use one or two layers instead of threeAttention-only transformer · In-context template matchingaccuracyHurt
increase depth from two to three attention layersAttention-only transformer · In-context template matchingaccuracyHelped
increase depth from three to four attention layersAttention-only transformer · In-context template matchinglearning speedHelped
increase the number of attention headsAttention-only transformer · Sequence classificationlearning speedHelped
increase the number of attention headsAttention-only transformer · In-context question answering and template matchingperformanceNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: synthetic sequence classification data synthetic in-context QA data synthetic template matching data synthetic in-context template matching data

Benchmarks: synthetic memorization synthetic in-context QA synthetic template matching synthetic in-context template matching

Metrics: accuracy loss

Baselines: single-layer transformer two-layer transformer four-layer transformer

Builds on: induction heads Tracr RASP

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy