O Que Aconteceu nas Camadas de LLMs ao Serem Treinadas para Pensamento Rápido vs. Lento: Uma Perspectiva de Gradiente
What Happened in LLMs Layers when Trained for Fast vs. Slow Thinking: A Gradient Perspective
October 31, 2024
Autores: Ming Li, Yanhong Li, Tianyi Zhou
cs.AI
Resumo
O que faz diferença no pós-treinamento de LLMs? Investigamos os padrões de treinamento de diferentes camadas em grandes modelos de linguagem (LLMs), através da lente do gradiente, ao treinar com diferentes respostas e modelos iniciais. Estamos especificamente interessados em como o pensamento rápido versus lento afeta os gradientes por camada, dada a recente popularidade de treinar LLMs em caminhos de raciocínio como corrente de pensamentos (CoT) e recompensas de processo. Em nosso estudo, o pensamento rápido sem CoT leva a gradientes maiores e maiores diferenças de gradientes entre as camadas do que o pensamento lento (CoT Detalhado), indicando a estabilidade de aprendizado trazida por este último. Além disso, os LLMs pré-treinados são menos afetados pela instabilidade do pensamento rápido do que os LLMs ajustados por instrução. Adicionalmente, estudamos se os padrões de gradiente podem refletir a correção das respostas ao treinar diferentes LLMs usando caminhos de pensamento lento versus rápido. Os resultados mostram que os gradientes do pensamento lento podem distinguir caminhos de raciocínio corretos e irrelevantes. Para efeito de comparação, realizamos análises de gradientes semelhantes em tarefas de aprendizado de conhecimento não baseadas em raciocínio, nas quais, no entanto, aumentar trivialmente o comprimento da resposta não leva a comportamentos semelhantes ao pensamento lento. Nosso estudo fortalece a compreensão fundamental do treinamento de LLMs e fornece novas perspectivas sobre sua eficiência e estabilidade, abrindo caminho para a construção de um agente Sistema-2 generalizável. Nosso código, dados e estatísticas de gradientes podem ser encontrados em: https://github.com/MingLiiii/Layer_Gradient.
English
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 gradient, when training with different responses and initial
models. 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. Moreover, pre-trained
LLMs are less affected by the instability of fast thinking than
instruction-tuned LLMs. 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.Summary
AI-Generated Summary