Editing
Transformer Architecture
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Creating</span> == Designing a transformer-based system architecture: '''1. Choose the right variant for the task''' <syntaxhighlight lang="text"> Task Classification: βββ Generating text/code β Decoder-only (GPT/LLaMA family) βββ Encoding for search/classification β Encoder-only (BERT/RoBERTa/E5) βββ Translation/Summarization β Encoder-Decoder (T5/BART) βββ Images β ViT or CLIP (vision-language) </syntaxhighlight> '''2. Efficient attention for long contexts''' * Flash Attention 2 for memory-efficient exact attention * Grouped Query Attention (GQA) β reduces KV-cache by sharing keys/values across query heads * Sliding window attention for documents '''3. Production serving architecture''' <syntaxhighlight lang="text"> User Request β Load Balancer β [Tokenizer service] β [Inference cluster: vLLM / TGI / Triton] β (continuous batching, PagedAttention) [GPU cluster with tensor parallelism] β [Detokenizer + safety filter] β Response </syntaxhighlight> '''4. Key efficiency techniques''' * Quantization: INT8/INT4 weights reduce memory 2β4Γ with minimal quality loss * Speculative decoding: a small "draft" model proposes tokens, a large model verifies them in parallel β 2β3Γ throughput * Prefix caching: cache shared system prompt KV-states across requests * Batching: group requests sharing prefixes to maximize GPU utilization [[Category:Artificial Intelligence]] [[Category:Deep Learning]] [[Category:Natural Language Processing]] [[Category:Transformer Architecture]] </div>
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information