메뉴
HN
Hacker News 39일 전

점점 복잡해지는 LLM 아키텍처

IMP
7/10
핵심 요약

초기의 단순했던 LLM 구조가 다양한 어텐션 변형과 MoE 등의 도입으로 인해 추천 시스템만큼 복잡해졌습니다. 성능 최적화가 필수적인 요구사항으로 자리 잡으면서 연구 개발의 유연성이 크게 떨어지는 문제가 발생하고 있습니다. 이를 해결하기 위해 초기부터 모듈의 조합과 검증이 용이한 구조 설계(FlexAttention 등)가 필수적입니다.

번역된 본문

점점 복잡해지는 LLM (Ian이 Modelling 카테고리에 작성)

2022년과 2023년경, Meta에서는 두 가지 큰 머신러닝 브랜치가 있었습니다. Llama로 이어진 LLM 연구는 깔끔하고 매끄러운 반복적 Transformer 모듈의 스택이었습니다. 반면 추천 시스템(recsys)의 그래프는 상당히 복잡하고 혼란스러웠습니다. 그리고 다행히도(?) 산업계는 LLM을 훨씬 더 복잡하게 만들어 이러한 상황을 따라잡았습니다.

Seb Raschka는 훌륭한 모델 아키텍처 갤러리를 유지하고 있습니다. 이를 통해 각 시대의 최고 오픈 모델인 Llama 3와 Nemotron 3 Ultra를 비교해 볼 수 있습니다. 어텐션(Attention)이 모든 것일 수는 있지만, 현대의 모델들은 확실히 그것의 매우 다양한 변형을 사용합니다. 쿼리 그룹화(query grouping), 압축(compressed), 희소(sparse), 선형(linear), 슬라이딩 윈도우(sliding-window) 등등이 있습니다. 전문가 혼합(Mixture-of-Experts, MoE)은 피드포워드 계층에 선택적 라우팅을 추가했고, 이후 어텐션 블록부터 잔차 스트림(residual stream)에 이르기까지 거의 모든 것에 라우팅을 적용하기 시작했습니다.

비전 및 오디오 인코더는 단순히 덧붙여지는(bolted on) 것에서 혼합되는(mixed-in) 것으로 발전했습니다. 또한 모델이 추론 시 여러 GPU에서 실행되도록 확장되면서, 모델 중간에 추가적인 통신 경계(comms ops)가 생겨났습니다. 이는 추천 시스템에서 일어났던 일과 크게 다르지 않습니다. 지난 10년 동안 추천 시스템의 기본 아키텍처는 비교적 단순한 '양대 탑(Two-tower)' 희소 신경망이었습니다. 복잡성은 지속적인 기능 향상에 대한 필요성과, 특히 추론 시의 효율성 유지에 대한 필요성 사이의 긴장에서 비롯되었습니다.

AI 에이전트가 이 문제를 해결해 줄 것이라고 가정하기 쉽습니다. 즉, 여러분이 PyTorch나 JAX 정의를 Claude나 다른 도구에 넘기고 최적으로 융합된 커널(fused kernels)을 생성하게 할 수 있다고 생각하는 것입니다. 이것이 작동하려면 생성된 결과가 맞는지 확인하기 위해 고정되고 사용 가능한 기준선(baseline)이 필요합니다. 추천 시스템에서 일어난 일은 성능 향상이 '선택적 최적화'였던 시기와 '필수 조건'이 된 시기 사이의 격차가 매우 좁아졌다는 것입니다. 개념적으로는 기준선을 제공하는 순수한 모델 정의를 유지할 수 있지만, 실제로는 모델을 훈련하고 테스트하는 데 상당한 리소스가 소모되며 성능 향상은 전체 시스템을 떠받치는 핵심 요소가 됩니다.

어텐션 변형 A를 B로 교체하려면 B가 10% 정도 느린 것은 감수할 수 있을지 모릅니다. 하지만 성능이 한 자릿수 이상 나빠지는 것은 감당할 수 없을 것입니다. A가 이미 융합 및 최적화되어 있다면, B가 탐구할 가치가 있는지조차 판단하려면 최소한 부분적으로 융합되고 최적화된 B 버전부터 만들어야 합니다. 연구 반복 루프는 단순히 '이 알려진 양을 최적화하라'는 것과는 다른 종류의 유연성을 요구합니다. 상당한 시간을 들여 수동으로 융합하는 방식으로 과거로 돌아갈 수도 없고, 확인할 기준선 없이 에이전트를 통해 미래로 나아갈 수도 없습니다. 유일한 해결책은 처음부터 조합 가능성(composability)을 염두에 두고 설계하는 것입니다.

최근 몇 년간 제가 가장 좋아했던 커널 개발 중 하나는 PyTorch의 FlexAttention이었습니다. 이는 전체 범주의 어텐션 연산을 가져와 Triton 템플릿을 통해 커널을 생성할 수 있게 해주었습니다. 이는 어텐션 커널에 대한 방대한 연구를 기반으로 했으며, 처음부터 조합 및 검증이 가능하도록 설계되었습니다. 덕분에 성능에 미치는 영향을 최소화하면서 다양한 실험을 할 수 있게 되었습니다.

Andrej Karpathy가 최근 Anthropic에 합류한 이유 중 일부는 프론티어에서 더 풍부한 자동 연구 스타일의 루프를 개발하기 위해서입니다. 하지만 그가 지난 몇 년간 보여주었듯이, 그런 높은 산을 오르기 위해서는 똑똑한 에이전트 설정만큼이나 아키텍처를 본질로 축소하고 조합 가능하게 만드는 능력이 중요합니다.

(각주 및 기타 메타 정보 생략)

원문 보기
원문 보기 (영어)
LLMs are complicated now Written by Ian in Modelling Back in 2022 and 2023 there were two big branches of machine learning happening at Meta 1 . The LLM work that led to Llama was a clean, smooth stack of repeated Transformer modules; the recommendation systems graphs were, by contrast, terrifying. Luckily, the industry has remedied that state of affairs by making LLMs a lot more complicated. Seb Raschka maintains an excellent gallery of model architectures. You can use it to diff two of the best open models of their respective eras, Llama 3 and Nemotron 3 Ultra. Attention might be all you need, but modern models certainly use a lot of different variants of it: query grouping, compressed, sparse, linear, sliding-window and more. Mixture-of-Experts added selective routing to feed-forward layers, and we have since started routing just about everything else too, from attention blocks to the residual stream. Vision and audio encoders have gone from bolted on to mixed-in, and models have scaled to run at inference time across multiple GPUs, which throws comms ops in that add extra boundaries in the middle of your model. This is not too different from what happened with recsys. The basic architecture of recommendation systems, for the best part of a decade, was a relatively straightforward two-tower sparse neural net. The complexity came from the tension between the need to continually increase capabilities and the need to stay efficient, particularly for inference. It's tempting to assume that agents will Fix This: that you'll hand your PyTorch or JAX definition to Claude Telenovela or whatever and have it generate optimally fused kernels 2 . To make that work you need a fixed, usable baseline to make sure that what is generated is… right. What happened with recsys was that the gap between performance being an optimization and performance being a necessity became very, very small. Conceptually you can keep a pure model definition that gives you a baseline; in practice, training and testing a model takes significant resources and performance improvements become load-bearing. If you want to swap attention variant A for variant B , you can afford for B to be ten percent slower. You probably can't afford for it to be an order-of-magnitude worse. If A is fused and optimized, you need at least a partially fused and optimized version of B before you can even tell whether it's worth exploring. The research iteration loop demands a different kind of flexibility than just “optimize this known quantity”. You can't hand-fuse your way back without investing significant time that might not be worth it, and you can't generate your way forward without a baseline to check. The only way out is to design for composability up front. One of my favorite kernel developments of the last few years was FlexAttention in PyTorch, which took a whole class of attention operations and allowed you to generate kernels for them, via Triton templates. It built on a huge body of work in attention kernels, and it was designed to be composable and verifiable up front: you can explore with only a very mild impact to performance. Andrej Karpathy recently joined Anthropic, in part to develop richer auto-research-style loops at the frontier. As he has spent the last few years showing, though, being able to cut architectures to their essence and make them composable is as important as a clever agentic setup in climbing that kind of hill. And many smaller ones, shout outs to all my Content Understanding and integrity peeps ↩︎ Like an automated Hazy Research ↩︎ gpu llm recsys triton More posts LLMs are complicated now June 19, 2026 FactWorld June 12, 2026 Somehow, more on distillation June 5, 2026 We can distill it for you wholesale May 31, 2026