프로필

설정

불러오는 중…

← 홈

도움말·문의

자주 묻는 질문

어떤 기능에 로그인이 필요한가요?

공개 논문의 해설과 논문 정보, 모델 구조, 관련 논문, 용어는 로그인 없이 볼 수 있습니다. 논문 올리기, 내 보관함, 읽기 기록, 논문 평가, 관심 분야 추천, 메일과 알림은 로그인해야 쓸 수 있습니다.

PDF 파일로도 올릴 수 있나요?

논문은 arXiv나 DOI 링크로 올리고, 해설은 모두에게 공개됩니다. 출처와 이용 조건이 확인되지 않아 해설을 공개할 수 없는 논문은 올릴 수 없습니다. PDF 파일 올리기와 나만 보기는 구독 회원만 쓸 수 있고, 파일로 올린 논문은 나만 보기로만 저장합니다. 제목으로 공식 정보를 찾는 검색은 버튼을 누를 때만 합니다.

그림과 AI 해설은 정확한가요?

그림은 논문 원본만 쓰고 이용 허락이 확인된 것만 보여 줍니다. 해설은 AI가 쓴 글이라 틀릴 수 있습니다. 중요한 주장과 수치, 그림의 맥락은 원문 근거로 확인해 주세요.

저작권 문제를 알리고 싶어요.

이용 조건과 원문 출처는 논문 정보 탭에 있습니다. 문제가 있으면 ‘문의하기’에서 ‘논문 내용·그림·저작권’을 골라 논문 링크와 문제가 되는 부분, 권리를 확인할 수 있는 근거를 보내 주세요. 접수만으로 권리가 확정되거나 바로 삭제되지는 않습니다. 검토 결과는 ‘내 문의’에서 볼 수 있습니다.

비밀번호를 잊었어요.

이메일로 가입했다면 로그인 창의 비밀번호 찾기에서 인증한 이메일로 다시 설정할 수 있습니다. Google, 네이버, 카카오로 가입했다면 그 서비스에서 비밀번호를 바꿔 주세요.

문의할 때 무엇을 적어야 하나요?

어느 화면에서 무엇을 하다 생긴 문제인지 논문 링크와 함께 적어 주세요. 비밀번호, API 키, 인증 코드, 전화번호 같은 개인정보는 적지 마세요. 문의와 답변은 Refivu에 저장되고 ‘내 문의’에서 볼 수 있습니다.

회원탈퇴는 어떻게 하나요?

설정의 내 계정에서 회원탈퇴를 누르세요. 지워지는 내용을 확인하고 본인 확인을 마치면 탈퇴됩니다. 다른 요청은 ‘문의하기’에서 ‘계정’을 골라 남겨 주세요.

논문 해설

Learning to (Learn at Test Time): RNNs with Expressive Hidden States

테스트 시점에 학습하는 법을 배우기: 표현력 있는 은닉 상태를 가진 RNN

  • 연구 문제 긴 문맥에서 선형 복잡도 RNN 레이어는 고정 크기 은닉 상태 때문에 토큰을 더 조건으로 삼아도 성능이 정체되는 문제가 있습니다.
  • 연구 방법 TTT 레이어는 은닉 상태를 기계학습 모델로 두고, 업데이트 규칙을 자기지도 손실에 대한 경사하강 한 단계로 구성합니다.
  • 주요 결과 TTT-Linear와 TTT-MLP는 8k와 32k 문맥에서 Mamba보다 더 좋은 perplexity를 보이며, 긴 문맥에서 토큰을 더 조건으로 삼을수록 perplexity를 계속 낮춥니다.

긴 문맥에서 RNN 레이어가 막히는 지점

Self-attention은 긴 문맥에서 성능이 좋지만 계산량이 토큰 길이에 대해 이차적으로 늘어납니다. 반면 기존 RNN 레이어는 토큰 수에 선형인 비용을 가지지만, 긴 문맥에서의 성능이 은닉 상태의 표현력에 의해 제한됩니다. RNN 레이어는 문맥 전체를 고정 크기의 은닉 상태로 압축해야 하므로, 수천에서 수백만 토큰의 구조와 관계를 상태 안에 담아야 합니다. 논문은 이 문제를 보여 주기 위해 Mamba의 perplexity를 토큰 위치별로 측정합니다. 같은 지표가 Transformer에서는 32k 문맥까지 계속 낮아지는 반면, Mamba에서는 16k 이후 정체됩니다. 이 관찰이 이 논문의 출발점입니다.

Figure 2: Comparing to Mamba, TTT-Linear and TTT-MLP have similar perplexity in 8k context (left) and
better use of long context (right). Evaluations follow Ka…

Figure 2 . Comparing to Mamba, TTT-Linear and TTT-MLP have similar perplexity in 8k context (left) and better use of long context (right). Evaluations follow Kaplan et al. [43]. Left: Scaling trends on the Pile with 8k context, zoomed in between 350M and 1.3B parameters. Right: Similar to Transformer, TTT-Linear and TTT-MLP can keep reducing perplexity by conditioning on more tokens, while Mamba cannot after 16k context. All methods have matched training FLOPs as Mamba 1.4B.

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 2쪽에서 그림 영역을 추출했습니다.

은닉 상태를 학습 모델로 바꾸는 TTT 레이어

TTT 레이어는 은닉 상태를 고정 벡터가 아니라 가중치 W를 가진 기계학습 모델 f로 둡니다. 업데이트 규칙은 자기지도 손실 ℓ에 대한 경사하강 한 단계입니다. 즉 W_t는 W_{t-1}에서 학습률 η와 그래디언트 ∇ℓ(W_{t-1}; x_t)를 사용해 갱신되며, 출력은 현재 가중치로 만든 f(x_t; W_t)입니다. 손실은 입력 x_t를 손상시킨 뷰에서 원래 뷰를 재구성하도록 설계되며, 학습 뷰 θ_K x_t, 레이블 뷰 θ_V x_t, 테스트 뷰 θ_Q x_t는 외부 루프에서 학습되는 투영입니다. 내부 루프는 test sequence에서도 W를 갱신하므로 이 과정을 테스트 시점의 학습으로 볼 수 있습니다.

여기서 W는 내부 루프의 은닉 상태이고, θ_K, θ_V, θ_Q는 외부 루프의 파라미터입니다. TTT-Linear는 f가 선형 모델인 인스턴스이고, TTT-MLP는 두 층 MLP를 쓰는 인스턴스입니다. 두 인스턴스 모두 f에 LayerNorm과 잔차 연결을 둡니다.

Figure 1: All sequence modeling layers can be expressed as a hidden state that transitions according to an
update rule. Our key idea is to make the hidden stat…

Figure 1 . All sequence modeling layers can be expressed as a hidden state that transitions according to an update rule. Our key idea is to make the hidden state itself a modelf with weightsW , and the update rule a gradient step on the self-supervised lossℓ. Therefore, updating the hidden state on a test sequence is equivalent to training the modelf at test time. This process, known as Test-Time Training (TTT), is programmed into our TTT layers.

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 1쪽에서 그림 영역을 추출했습니다.
Figure 4: The self-supervised TTT lossℓ averaged over all test sequences of the formx1,...,x T whereT = 2048,
for the first three TTT layers in a network with…

Figure 4 . The self-supervised TTT lossℓ averaged over all test sequences of the formx1,...,x T whereT = 2048, for the first three TTT layers in a network with 125M parameters. One step of gradient descent is able to reduce TTT loss from ℓ(Wt−1;xt) toℓ(Wt;xt). As t moves further along the test sequence, ℓ(Wt;xt) also improves further fromℓ(W0;xt). For visual clarity, loss values have been averaged over a sliding window of 10 timesteps. See Figure 14 (in Appendix) for complete results on all 12 layers.

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.
Figure 8: Parametric learners need to define two attributes: model and optimizer (left), and each learner
uniquely induces a TTT layer (right). Two of the indu…

Figure 8 . Parametric learners need to define two attributes: model and optimizer (left), and each learner uniquely induces a TTT layer (right). Two of the induced TTT layers: TTT-Linear and TTT-MLP, are proposed in this paper. The TTT layer with a linear model and batch GD is equivalent to linear attention [44].

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.
Table 2: In summary, our paper reformulates supervised learning as learning to learn, with two nested loops.
Highlighted rows of the outer loop are the same as…

Table 2 . In summary, our paper reformulates supervised learning as learning to learn, with two nested loops. Highlighted rows of the outer loop are the same as in the regular training. Parameters of the outer loop become hyper-parameters of the inner loop. Intuitively, the inner loop,i.e. TTT, is “one level below” regular training.

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 18쪽에서 그림 영역을 추출했습니다.

미니배치 업데이트와 dual form으로 병렬화

토큰마다 가중치를 순차적으로 갱신하는 online gradient descent는 W_t가 W_{t-1}에 의존하므로 병렬화하기 어렵습니다. 논문은 토큰을 길이 b의 미니배치로 나누고, 각 토큰의 그래디언트를 직전 미니배치의 마지막 시점 가중치에서 계산하는 mini-batch gradient descent를 사용합니다. 실험에서는 b = 16을 사용했으며, 이 값은 속도와 품질 사이의 절충으로 설명됩니다. 여기에 더해 미니배치 내부 연산을 행렬곱 중심으로 재구성한 dual form을 도입합니다. 이 방식은 개별 그래디언트 행렬 G_t와 중간 가중치 W_t를 명시적으로 만들지 않고도 같은 출력을 계산합니다.

논문은 dual form이 이론적 복잡도를 일부 희생하는 대신 하드웨어 활용도를 높이며, JAX 구현에서 학습이 primal form보다 5배 넘게 빠르다고 보고합니다.

Figure 6: High-level computation graph of the first TTT mini-batch, where nodes are variables and edges are
computations. The blue nodes are input variables, a…

Figure 6 . High-level computation graph of the first TTT mini-batch, where nodes are variables and edges are computations. The blue nodes are input variables, and yellow are output. Subsection 2.4: Since G1,...,G b are not connected, they have no sequential dependency on each other, therefore can be computed in parallel. Subsection 2.5: We do not actually materialize the white nodes – the intermediateGs andW s – to compute the output variables in the dual form.

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.

선형 어텐션과 셀프 어텐션과의 이론적 대응

논문은 TTT 레이어의 특수한 설정이 기존 시퀀스 모델과 같은 출력을 낸다는 두 정리를 제시합니다. 첫 번째 정리는 f(x) = Wx 형태의 선형 내부 모델, 초기값 W_0 = 0, 배치 경사하강과 η = 1/2을 쓰면 출력 규칙이 선형 어텐션과 같은 출력열을 만든다고 말합니다. 두 번째 정리는 Nadaraya-Watson 추정기를 내부 모델로 쓰고 커널이 θ_K와 θ_Q에 의해 정해질 때 TTT 레이어가 셀프 어텐션과 같은 출력열을 만든다고 말합니다. 이 결과는 TTT를 어텐션과 RNN 사이의 연결점으로 해석하는 근거가 됩니다. 다만 이 대응은 위의 특정 설정에 대한 결과이며, 미니배치 설정이나 LayerNorm을 포함한 기본 TTT-Linear 구조 전체에 대한 등가성으로 읽으면 안 됩니다.

짧은 문맥과 긴 문맥에서의 perplexity 비교

짧은 문맥의 평가는 Pile 데이터셋에서 2k와 8k 문맥 길이로 수행됩니다. 모델 크기는 125M, 350M, 760M, 1.3B이며 Mamba는 130M, 370M, 790M, 1.4B에 대응합니다. 2k 문맥에서는 TTT-Linear (M), Mamba, Transformer의 성능이 거의 겹칩니다. 8k 문맥에서는 TTT-Linear (M)과 TTT-MLP (M)이 Mamba보다 더 좋은 성능을 보입니다. 긴 문맥의 평가는 Books3에서 1k부터 32k까지 2배 간격으로 수행되며, 학습 배치는 문맥 길이와 관계없이 0.5M 토큰입니다. 32k 문맥에서는 TTT-Linear (M)과 TTT-MLP (M)이 Mamba보다 더 좋은 성능을 보입니다.

같은 긴 문맥 실험에서 Transformer는 처음부터 학습한 설정과 긴 문맥 fine-tuning 설정으로 함께 비교됩니다. 저자들은 TTT 레이어의 이점이 문맥 길이가 늘수록 커진다고 보고하지만, 이는 이 두 데이터셋과 이 모델 범위에서 관찰된 결과입니다. Books3에서는 2k 문맥에서 Mamba가 TTT-Linear보다 약간 더 좋습니다. 따라서 이 결과를 모든 문맥 길이의 일반 규칙으로 옮기면 안 됩니다.

Figure 10: Evaluations for context lengths 2k and 8k on the Pile. Details in Subsection 3.1. TTT-Linear has
comparable performance as Mamba at 2k context, and…

Figure 10 . Evaluations for context lengths 2k and 8k on the Pile. Details in Subsection 3.1. TTT-Linear has comparable performance as Mamba at 2k context, and better performance at 8k.

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 13쪽에서 그림 영역을 추출했습니다.
Figure 11: Evaluations for context lengths 2k and 32k on Books. Details in Subsection 3.2. Our complete results
for context lengths 1k, 2k, 4k, 8k, 16k, 32k, i…

Figure 11 . Evaluations for context lengths 2k and 32k on Books. Details in Subsection 3.2. Our complete results for context lengths 1k, 2k, 4k, 8k, 16k, 32k, including Transformer finetuning, are in Figure 15 (in Appendix). Most observations from the Pile still hold.

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 14쪽에서 그림 영역을 추출했습니다.
Table 3: Training configurations for all experiments. This table reproduces Table 12 in the Mamba paper.
The only difference is that the learning rate they use…

Table 3 . Training configurations for all experiments. This table reproduces Table 12 in the Mamba paper. The only difference is that the learning rate they use for Mamba and Transformer is 5× the values in their Table 12, and we report the actual values (5×). Note that this table only applies to TTT-Linear, TTT-MLP, and Transformers, as Mamba does not follow the multi-head residual block structure inherited from Transformers.

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 30쪽에서 그림 영역을 추출했습니다.
Figure 15: Complete results on Books, presented by context lengths. Figure 11 in Subsection 3.2 presents the
subset of results for context lengths 2k and 32k

Figure 15 . Complete results on Books, presented by context lengths. Figure 11 in Subsection 3.2 presents the subset of results for context lengths 2k and 32k.

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 32쪽에서 그림 영역을 추출했습니다.

실행 비용과 남은 한계

TTT 인스턴스는 FLOPs 기준으로 효율적이더라도 실제 wall-clock 시간에서는 추가 비용이 남습니다. 특히 TTT-MLP는 FLOPs 측면에서 효과적이지만, MLP 구조 때문에 wall-clock 시간이 FLOPs 증가보다 더 크게 늘어납니다. 추론 지연 측정에서 TTT-Linear, TTT-MLP, Mamba의 토큰당 지연은 문맥 길이에 따라 Transformer보다 천천히 증가하는 것으로 보고됩니다. 그러나 이 측정은 특정 A100 GPU와 구현에 대한 결과이며, 논문은 자신들의 시스템 최적화가 아직 초기 단계라고 밝힙니다. 따라서 TTT 레이어가 실제 응용에서 항상 효율적이라고 결론지을 수는 없습니다.

Figure 12: Latency on an NVIDIA A100 GPU with 80G HBM and PCIe connections

Figure 12 . Latency on an NVIDIA A100 GPU with 80G HBM and PCIe connections.

원문 · CC BY 4.0 · Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin · Learning to (Learn at Test Time): RNNs with Expressive Hidden States · 원문 그림 인용 · 원본 PDF 15쪽에서 그림 영역을 추출했습니다.

논문 정보

저자
Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin
학회·저널
arXiv · 프리프린트
최초 공개일
2024년 7월 5일
등록일
2026년 10월 30일
수정일
2025년 8월 31일
버전
v4
arXiv
2407.04620
분류
cs.LG · cs.AI · cs.CL
원문 이용 조건
CC BY 4.0
제공 범위
논문 정보, 해설, 허용된 원문 그림

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

초록

Self-attention performs well in long context but has quadratic complexity. Existing RNN layers have linear complexity, but their performance in long context is limited by the expressive power of their hidden states. We present a practical framework for instantiating sequence modeling layers with linear complexity and expressive hidden states. The key idea is to make the hidden state a machine learning model itself, and the update rule a step of self-supervised learning. Since the hidden state is updated by training even on test sequences, our layers are called Test-Time Training (TTT) layers. We consider two instantiations: TTT-Linear and TTT-MLP, whose hidden state is a linear model and a two-layer MLP respectively. We evaluate our instantiations at the scale of 125M to 1.3B parameters, comparing with a strong Transformer and Mamba, a modern RNN. Similar to Transformer, TTT-Linear and TTT-MLP can keep reducing perplexity by conditioning on more tokens, while Mamba cannot after 16k context. TTT-MLP still faces challenges in memory I/O, but shows larger potential in long context, pointing to a promising direction for future research.

원문 인용

Yu Sun, Xinhao Li, Karan Dalal, Jiarui Xu, Arjun Vikram, Genghan Zhang, Yann Dubois, Xinlei Chen, Xiaolong Wang, Sanmi Koyejo, Tatsunori Hashimoto, Carlos Guestrin (2024). Learning to (Learn at Test Time): RNNs with Expressive Hidden States. arXiv:2407.04620v4. https://arxiv.org/abs/2407.04620v4

BibTeX
@misc{sun2024learning,
  title = {{Learning to (Learn at Test Time): RNNs with Expressive Hidden States}},
  author = {Yu Sun and Xinhao Li and Karan Dalal and Jiarui Xu and Arjun Vikram and Genghan Zhang and Yann Dubois and Xinlei Chen and Xiaolong Wang and Sanmi Koyejo and Tatsunori Hashimoto and Carlos Guestrin},
  year = {2024},
  eprint = {2407.04620},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.04620v4}
}

관련 논문 보기다른 논문 둘러보기

논문 미리 보기
계정 보안

Google 계정 연결

Google 계정을 연결하면 그 계정으로도 로그인할 수 있습니다.

Refivu

회원탈퇴

Refivu
Refivu

회원가입