Цепочка обучения моделей для языковой модели
Chain-of-Model Learning for Language Model
May 17, 2025
Авторы: Kaitao Song, Xiaohua Wang, Xu Tan, Huiqiang Jiang, Chengruidong Zhang, Yongliang Shen, Cen LU, Zihao Li, Zifan Song, Caihua Shan, Yansen Wang, Kan Ren, Xiaoqing Zheng, Tao Qin, Yuqing Yang, Dongsheng Li, Lili Qiu
cs.AI
Аннотация
В данной статье мы предлагаем новую парадигму обучения, названную Chain-of-Model (CoM), которая интегрирует причинно-следственные связи в скрытые состояния каждого слоя в виде цепочки, что обеспечивает значительную эффективность масштабирования при обучении модели и гибкость при её развертывании. Мы вводим концепцию Chain-of-Representation (CoR), которая формулирует скрытые состояния на каждом слое как комбинацию нескольких подпредставлений (т.е. цепочек) на уровне скрытой размерности. На каждом слое каждая цепочка из выходных представлений может видеть только все предшествующие ей цепочки во входных представлениях. В результате модель, построенная на основе CoM, может постепенно увеличивать свой размер, добавляя цепочки на основе предыдущих моделей (т.е. цепочек), и предоставлять несколько подмоделей разного размера для гибкого вывода, используя разное количество цепочек. На основе этого принципа мы разработали Chain-of-Language-Model (CoLM), которая интегрирует идею CoM в каждый слой архитектуры Transformer. На основе CoLM мы также представляем CoLM-Air, вводя механизм совместного использования ключей и значений (KV), при котором все ключи и значения вычисляются в первой цепочке, а затем используются во всех остальных. Этот дизайн демонстрирует дополнительную расширяемость, такую как возможность бесшовного переключения языковых моделей, ускорение предварительного заполнения и т.д. Экспериментальные результаты показывают, что наше семейство моделей CoLM может достичь сопоставимой производительности с классическим Transformer, одновременно обеспечивая большую гибкость, такую как постепенное масштабирование для повышения эффективности обучения и предоставление нескольких моделей разного размера для гибкого вывода, открывая новые пути для создания языковых моделей. Наш код будет опубликован в будущем по адресу: https://github.com/microsoft/CoLM.
English
In this paper, we propose a novel learning paradigm, termed Chain-of-Model
(CoM), which incorporates the causal relationship into the hidden states of
each layer as a chain style, thereby introducing great scaling efficiency in
model training and inference flexibility in deployment. We introduce the
concept of Chain-of-Representation (CoR), which formulates the hidden states at
each layer as a combination of multiple sub-representations (i.e., chains) at
the hidden dimension level. In each layer, each chain from the output
representations can only view all of its preceding chains in the input
representations. Consequently, the model built upon CoM framework can
progressively scale up the model size by increasing the chains based on the
previous models (i.e., chains), and offer multiple sub-models at varying sizes
for elastic inference by using different chain numbers. Based on this
principle, we devise Chain-of-Language-Model (CoLM), which incorporates the
idea of CoM into each layer of Transformer architecture. Based on CoLM, we
further introduce CoLM-Air by introducing a KV sharing mechanism, that computes
all keys and values within the first chain and then shares across all chains.
This design demonstrates additional extensibility, such as enabling seamless LM
switching, prefilling acceleration and so on. Experimental results demonstrate
our CoLM family can achieve comparable performance to the standard Transformer,
while simultaneously enabling greater flexiblity, such as progressive scaling
to improve training efficiency and offer multiple varying model sizes for
elastic inference, paving a a new way toward building language models. Our code
will be released in the future at: https://github.com/microsoft/CoLM.Summary
AI-Generated Summary