Transformer란 무엇인가
Transformer는 입력 데이터를 처리할 때 자체 주의 메커니즘을 사용하여 입력 데이터의 서로 다른 부분의 중요성을 평가하는 딥 러닝 모델로, 자연어 처리와 같은 작업에서 뛰어납니다.
Transformer는 "Attention is All You Need" 논문에서 소개되었으며, 특히 자연어 처리(NLP) 분야에서 AI 분야에 혁명을 일으켰습니다. 데이터를 순차적으로 처리하는 순환 신경망(RNN)과 달리, Transformer는 자체 주의를 사용하여 모든 입력 데이터를 동시에 분석하여 병렬화 및 더 빠른 훈련을 가능하게 합니다. 이 아키텍처를 통해 모델은 입력의 서로 다른 부분 간의 관계를 이해할 수 있으며, 기계 번역, 텍스트 요약 및 질문 응답과 같은 작업에서 성능 향상을 이끌어냅니다. 자체 주의 메커니즘을 통해 모델은 위치에 관계없이 입력 시퀀스의 가장 관련성이 높은 부분에 집중하여 장거리 종속성을 효과적으로 캡처할 수 있습니다.
graph LR
Center["Transformer란 무엇인가"]:::main
Pre_neural_network["neural-network"]:::pre --> Center
click Pre_neural_network "/terms/neural-network"
Pre_linear_algebra["linear-algebra"]:::pre --> Center
click Pre_linear_algebra "/terms/linear-algebra"
Pre_deep_learning["deep-learning"]:::pre --> Center
click Pre_deep_learning "/terms/deep-learning"
Rel_transformer_architecture["transformer-architecture"]:::related -.-> Center
click Rel_transformer_architecture "/terms/transformer-architecture"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧠 지식 테스트
🧒 5살도 이해할 수 있게 설명
It's like a super-smart reader that can look at all the words in a sentence at once and figure out which words are most important to understand the meaning of each individual word.
🤓 Expert Deep Dive
The Transformer model's success stems from its ability to model dependencies without regard to their distance in the input or output sequences. The self-attention mechanism computes a weighted sum of value vectors, where the weight assigned to each value is determined by the compatibility (dot product) of its corresponding key vector with a query vector. This allows for direct modeling of relationships between any two positions in the sequence. Multi-head attention further enhances this by allowing the model to jointly attend to information from different representation subspaces at different positions. The encoder uses stacked self-attention and point-wise feed-forward layers, while the decoder adds masked self-attention (to prevent attending to future tokens) and encoder-decoder attention. The absence of recurrence makes it highly parallelizable, leading to faster training times on modern hardware compared to RNNs. However, the quadratic complexity of self-attention with respect to sequence length ($O(n^2)$) remains a bottleneck for very long sequences, prompting research into more efficient variants.