What Happened in LLMs Layers when Trained for Fast vs. Slow Thinking: A Gradient Perspective

Ming Li, Yanhong Li, Tianyi Zhou
10/31/2024
cs.CLcs.AIcs.LG

Official code: MingLiiii/Layer_Gradient (75 stars, last commit 2025-06-25).

Abstract

What makes a difference in the post-training of LLMs? We investigate the training patterns of different layers in large language models (LLMs) through the lens of the gradient. We are specifically interested in how fast vs. slow thinking affects the layer-wise gradients, given the recent popularity of training LLMs on reasoning paths such as chain-of-thoughts (CoT) and process rewards. In our study, fast thinking without CoT leads to larger gradients and larger differences of gradients across layers than slow thinking (Detailed CoT), indicating the learning stability brought by the latter. Additionally, we study whether the gradient patterns can reflect the correctness of responses when training different LLMs using slow vs. fast thinking paths. The results show that the gradients of slow thinking can distinguish correct and irrelevant reasoning paths. As a comparison, we conduct similar gradient analyses on non-reasoning knowledge learning tasks, on which, however, trivially increasing the response length does not lead to similar behaviors of slow thinking. Our study strengthens fundamental understandings of LLM training and sheds novel insights on its efficiency and stability, which pave the way towards building a generalizable System-2 agent. Our code, data, and gradient statistics can be found in: https://github.com/MingLiiii/Layer_Gradient.

View on arXivView PDF

Code Implementations(1)

[ACL'25 Oral] What Happened in LLMs Layers when Trained for Fast vs. Slow Thinking: A Gradient Perspective

753Shell, PythonOct 31, 20241 years ago

Similar Papers

Cite this paper

@article{li2024what,
  title  = {What Happened in LLMs Layers when Trained for Fast vs. Slow Thinking: A Gradient Perspective},
  author = {Ming Li and Yanhong Li and Tianyi Zhou},
  year   = {2024},
  eprint = {2410.23743},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.23743v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.23743.svg)](https://codeofpaper.com/paper/2410.23743)

Discussion