Saved in:
Bibliographic Details
Main Authors: Zhu, Hanlin, Huang, Baihe, Zhang, Shaolun, Jordan, Michael, Jiao, Jiantao, Tian, Yuandong, Russell, Stuart
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2405.04669
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917818954416128
author Zhu, Hanlin
Huang, Baihe
Zhang, Shaolun
Jordan, Michael
Jiao, Jiantao
Tian, Yuandong
Russell, Stuart
author_facet Zhu, Hanlin
Huang, Baihe
Zhang, Shaolun
Jordan, Michael
Jiao, Jiantao
Tian, Yuandong
Russell, Stuart
contents Auto-regressive large language models (LLMs) show impressive capacities to solve many complex reasoning tasks while struggling with some simple logical reasoning tasks such as inverse search: when trained on '$A \to B$' (e.g., 'Tom is the parent of John'), LLM fails to directly conclude '$B \gets A$' (e.g., 'John is the child of Tom') during inference even if the two sentences are semantically identical, which is known as the 'reversal curse'. In this paper, we theoretically analyze the reversal curse via the training dynamics of (stochastic) gradient descent for two auto-regressive models: (1) a bilinear model that can be viewed as a simplification of a one-layer transformer; (2) one-layer transformers under certain assumptions. Our analysis reveals that for both models, the reversal curse is a consequence of the (effective) model weights 'asymmetry', i.e., the increase of weights from a token $A$ to token $B$ during training does not necessarily cause the increase of the weights from $B$ to $A$, which is caused by the training dynamics under certain choice of loss function and the optimization space of model parameters. Moreover, our analysis can be naturally applied to other logical reasoning tasks such as chain-of-thought (COT), which provides a new perspective different from previous work that focuses on expressivity. Finally, we conduct experiments to validate our theory on multi-layer transformers under different settings. Our code is available at https://github.com/marlo-z/reversal_curse_analysis/.
format Preprint
id arxiv_https___arxiv_org_abs_2405_04669
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamics
Zhu, Hanlin
Huang, Baihe
Zhang, Shaolun
Jordan, Michael
Jiao, Jiantao
Tian, Yuandong
Russell, Stuart
Machine Learning
Computation and Language
Auto-regressive large language models (LLMs) show impressive capacities to solve many complex reasoning tasks while struggling with some simple logical reasoning tasks such as inverse search: when trained on '$A \to B$' (e.g., 'Tom is the parent of John'), LLM fails to directly conclude '$B \gets A$' (e.g., 'John is the child of Tom') during inference even if the two sentences are semantically identical, which is known as the 'reversal curse'. In this paper, we theoretically analyze the reversal curse via the training dynamics of (stochastic) gradient descent for two auto-regressive models: (1) a bilinear model that can be viewed as a simplification of a one-layer transformer; (2) one-layer transformers under certain assumptions. Our analysis reveals that for both models, the reversal curse is a consequence of the (effective) model weights 'asymmetry', i.e., the increase of weights from a token $A$ to token $B$ during training does not necessarily cause the increase of the weights from $B$ to $A$, which is caused by the training dynamics under certain choice of loss function and the optimization space of model parameters. Moreover, our analysis can be naturally applied to other logical reasoning tasks such as chain-of-thought (COT), which provides a new perspective different from previous work that focuses on expressivity. Finally, we conduct experiments to validate our theory on multi-layer transformers under different settings. Our code is available at https://github.com/marlo-z/reversal_curse_analysis/.
title Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamics
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2405.04669