Tianyuan Zhang1,
Sai Bi2,
Yicong Hong2,
Kai Zhang2,
Fujun Luan2,
Songlin Yang1,
Kalyan Sunkavalli2,
William T. Freeman1,
Hao Tan2
1MIT 2Adobe Research
We provide minimal implementations for a LaCT layer in minimal_implementations/. This implementation serves as a starting point for understanding, modifying, and creating your own version of LaCT.
November 18: Added Triton kernels for the fused TTT layer (see lact_llm/lact_model/ttt_operation_fused_kernel.py for implementation, with a updated moddel config in configs/760M_lact_swiglu_nh4_fwlow_rank_momentum_fused_kernel.json). This reduces training memory consumption. The triton kernel fuse several matmul with epilogues to reduce read and writes in global mememory.
If you find this codebase useful for your research, please kindly cite our paper:
@article{zhang2025test,
title={Test-time training done right},
author={Zhang, Tianyuan and Bi, Sai and Hong, Yicong and Zhang, Kai and Luan, Fujun and Yang, Songlin and Sunkavalli, Kalyan and Freeman, William T and Tan, Hao},
journal={arXiv preprint arXiv:2505.23884},
year={2025}
}
11 commits
2 commits
Python
99.7%
Tianyuan Zhang1,
Sai Bi2,
Yicong Hong2,
Kai Zhang2,
Fujun Luan2,
Songlin Yang1,
Kalyan Sunkavalli2,
William T. Freeman1,
Hao Tan2
1MIT 2Adobe Research
We provide minimal implementations for a LaCT layer in minimal_implementations/. This implementation serves as a starting point for understanding, modifying, and creating your own version of LaCT.
November 18: Added Triton kernels for the fused TTT layer (see lact_llm/lact_model/ttt_operation_fused_kernel.py for implementation, with a updated moddel config in configs/760M_lact_swiglu_nh4_fwlow_rank_momentum_fused_kernel.json). This reduces training memory consumption. The triton kernel fuse several matmul with epilogues to reduce read and writes in global mememory.
If you find this codebase useful for your research, please kindly cite our paper:
@article{zhang2025test,
title={Test-time training done right},
author={Zhang, Tianyuan and Bi, Sai and Hong, Yicong and Zhang, Kai and Luan, Fujun and Yang, Songlin and Sunkavalli, Kalyan and Freeman, William T and Tan, Hao},
journal={arXiv preprint arXiv:2505.23884},
year={2025}
}
11 commits
2 commits
Python
99.7%