Tracr-Injection: Distilling Algorithms into Pre-trained Language Models

Motivated by the surge of large language models, there has been a push to formally characterize the symbolic abilities intrinsic to the transformer architecture.A programming language, called RASP, has been proposed, which can be directly compiled into transformer weights to implement these algorithms.However, the tasks that can be implemented in RASP are often uncommon to learn from natural unsupervised data, showing a mismatch between theoretical capabilities of the transformer architecture, and the practical learnability of these capabilities from unsupervised data.We propose tracr-injection, a method that allows us to distill algorithms written in RASP directly into a pre-trained language model.We showcase our method by injecting 3 different algorithms into a language model.We show how our method creates an interpretable subspace within the model's residual stream, which can be decoded into the variables present in the code of the RASP algorithm.Additionally, we found that the proposed method can improve out-of-distribution performance compared to our baseline, indicating that indeed a more symbolic mechanism is taking place in the inner workings of the model.We release the code used to run our experiments 1 .

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.findings-acl.146
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Tracr-Injection: Distilling Algorithms into Pre-trained Language Models

Tomás Vergara Browne, Álvaro Soto
Natural Language Processing Techniques
article

Tracr-Injection: Distilling Algorithms into Pre-trained Language Models

Tomás Vergara Browne, Álvaro Soto
article en

Abstract

Motivated by the surge of large language models, there has been a push to formally characterize the symbolic abilities intrinsic to the transformer architecture.A programming language, called RASP, has been proposed, which can be directly compiled into transformer weights to implement these algorithms.However, the tasks that can be implemented in RASP are often uncommon to learn from natural unsupervised data, showing a mismatch between theoretical capabilities of the transformer architecture, and the practical learnability of these capabilities from unsupervised data.We propose tracr-injection, a method that allows us to distill algorithms written in RASP directly into a pre-trained language model.We showcase our method by injecting 3 different algorithms into a language model.We show how our method creates an interpretable subspace within the model's residual stream, which can be decoded into the variables present in the code of the RASP algorithm.Additionally, we found that the proposed method can improve out-of-distribution performance compared to our baseline, indicating that indeed a more symbolic mechanism is taking place in the inner workings of the model.We release the code used to run our experiments 1 .

Agencia Nacional de Investigación y Desarrollo
Quality Education
Openalex Percentile: Top 90%
Natural Language Processing Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.