In-context Learning and Gradient Descent Revisited (2311.07772v4)
Abstract: In-context learning (ICL) has shown impressive results in few-shot learning tasks, yet its underlying mechanism is still not fully understood. A recent line of work suggests that ICL performs gradient descent (GD)-based optimization implicitly. While appealing, much of the research focuses on simplified settings, where the parameters of a shallow model are optimized. In this work, we revisit evidence for ICL-GD correspondence on realistic NLP tasks and models. We find gaps in evaluation, both in terms of problematic metrics and insufficient baselines. We show that surprisingly, even untrained models achieve comparable ICL-GD similarity scores despite not exhibiting ICL. Next, we explore a major discrepancy in the flow of information throughout the model between ICL and GD, which we term Layer Causality. We propose a simple GD-based optimization procedure that respects layer causality, and show it improves similarity scores significantly.
- Transformers learn to implement preconditioned gradient descent for in-context learning.
- What learning algorithm is in-context learning? investigations with linear models.
- Greedy layer-wise training of deep networks. Advances in neural information processing systems, 19.
- Language models are few-shot learners. In Advances in Neural Information Processing Systems, volume 33, pages 1877–1901. Curran Associates, Inc.
- Transformers implement functional gradient descent to learn non-linear functions in context.
- Why can gpt learn in-context? language models implicitly perform gradient descent as meta-optimizers.
- Analyzing transformers in embedding space.
- The commitmentbank: Investigating projection in naturally occurring discourse.
- Jump to conclusions: Short-cutting transformers with linear transformations.
- A mathematical framework for transformer circuits. Transformer Circuits Thread. Https://transformer-circuits.pub/2021/framework/index.html.
- Transformer feed-forward layers build predictions by promoting concepts in the vocabulary space.
- In-context learning creates task vectors.
- Risks from learned optimization in advanced machine learning systems.
- nostalgebraist. 2020. interpreting gpt: the logit lens. https://www.lesswrong.com/posts/AcKRB8wDpdaN6v6ru/interpreting-gpt-the-logit-lens.
- In-context learning and induction heads. ArXiv, abs/2209.11895.
- A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. In Proceedings of the 42nd Annual Meeting on Association for Computational Linguistics, ACL ’04, page 271–es, USA. Association for Computational Linguistics.
- Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In Proceedings of the 43rd Annual Meeting on Association for Computational Linguistics, ACL ’05, page 115–124, USA. Association for Computational Linguistics.
- Trainable transformer in transformer. ArXiv, abs/2307.01189.
- Do pretrained transformers really learn in-context by gradient descent?
- Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, pages 1631–1642, Seattle, Washington, USA. Association for Computational Linguistics.
- Branchynet: Fast inference via early exiting from deep neural networks.
- Function vectors in large language models.
- Transformers learn in-context by gradient descent. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 35151–35174. PMLR.
- Uncovering mesa-optimization algorithms in transformers.
- Emergent abilities of large language models.
- An explanation of in-context learning as implicit bayesian inference.
- Character-level convolutional networks for text classification. In Advances in Neural Information Processing Systems, volume 28. Curran Associates, Inc.