All bites
The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.
4247 bites
Page 49
Tokenization and Input Embeddings in LLMs
Tokenization splits language into tokens, and embeddings map token IDs into vectors with meaning. Every transformer does this first. The footgun is assuming one token equals one word—token counts behave unpredictably when words merge or split.
Position-wise FFN: Each Token's Private Workshop
Think of the position-wise FFN as each token's private gym after attention: it bulks up features and stores facts, but never shares between seats. Cutting it to save parameters starves the model because attention cannot do this alone.
Transformer Encoder Block
A Transformer encoder block mixes full sequence context in parallel: every token attends to all others to refine its vector. It drives bidirectional models like BERT. The footgun is using it unmasked for generation, which leaks future information.
Masked Multi-Head Attention in Decoders
Masked multi-head attention runs parallel detectors over past tokens only, stopping a decoder from peeking ahead. It powers autoregressive models like GPT. The footgun is using the causal mask in bidirectional encoders, which silently destroys context.
Masked Language Modeling: Fill-in-the-Blank Pretraining
MLM hides random tokens and trains the model to reconstruct them from context. It powers BERT-style encoders for classification and search. The catch is that it never learns left-to-right generation, so it needs extra machinery for open-ended text.
Function Calling: LLMs Using Tools
Function calling turns an LLM into an API translator: it reads input and emits JSON telling your code which tool to run. Use it when the model needs live data it cannot store in weights. The model never executes the call and can hallucinate arguments.
Tool Definition Schema: Contracts for LLM Actions
A tool schema is JSON that tells an LLM what actions it can take. Use it when you want the model to call APIs instead of just chatting. The model only emits arguments; it never runs the tool, and vague descriptions cause silent failures.
ROUGE Score: Recall Overlap for Generation
ROUGE measures text generation recall by counting overlapping words and phrases against a reference. It is the default metric for summarization benchmarks. Perfect paraphrases score poorly while keyword-stuffed nonsense can score high.
Hallucination Detection in LLMs
Hallucination detection is the set of techniques for flagging when a language model states something fluent but false or unsupported, using signals like self-consistency, model uncertainty, and grounding against retrieved evidence to catch fabrications before…
HHH: The Three-Way Tug-of-War in LLMs
HHH frames LLM alignment as a three-way tug-of-war: helpful, harmless, honest. It governs RLHF reward models and safety filters, where maximizing one axis weakens the others. The footgun is optimizing helpfulness, producing sycophants or dangerous compliance.
Data Poisoning: Corrupting Models at the Source
Data poisoning is slipping lies into a textbook that a model memorizes forever. It shows up when you train on scraped web data or open fine-tuning sets. The footgun is assuming clean benchmarks mean clean weights; poison can hide until a trigger appears.
NIST AI RMF for LLM Deployment
The NIST AI RMF is a pre-flight checklist for organizational AI risk, not just code bugs. Teams use it to justify LLM deployment across legal, security, and fairness dimensions.
State-Space Models Replace Quadratic Attention
State-space models replace attention with recurrent linear dynamics, scaling linearly with sequence length. They excel at long DNA, audio, and video modeling. The footgun is naive discretization, which collapses stability on long sequences.
RoPE: Encoding Position with Rotation
Rotary Position Embedding (RoPE) encodes position by rotating token embeddings, where the angle depends on the token's absolute spot in the sequence. This is used in Transformers like Llama to handle long contexts, as the attention score naturally becomes a function of relative distance. The main footgun is assuming standard position embeddings extrapolate; RoPE is designed for sequence length flexibility, unlike many absolute position encodings which fail on longer inputs.
Instruction Tuning: Teaching Models to Follow Orders
Instruction tuning teaches a language model to generalize by finetuning it on a massive collection of tasks described in plain English. This transforms a raw pretrained model, which just predicts the next word, into one that can follow commands on unseen tasks without any examples (zero-shot). The footgun is mistaking this for simple finetuning on one task; its power comes from the sheer diversity of instructional tasks used during training.
Speculative Decoding: Faster LLM Inference, Same Results
Speculative decoding accelerates LLM inference by using a small, fast "draft" model to predict a sequence of tokens. The large, accurate model then validates this entire sequence in a single parallel pass, instead of generating one token at a time. This is used to get 2-3x speedups on production models without retraining. The common misconception is that it's a lossy approximation; in reality, it produces bit-for-bit identical output to the original model.
Constitutional AI: Teaching an AI Right from Wrong
Constitutional AI teaches a model to be harmless by making it follow a set of principles—a constitution—instead of relying on human-labeled examples of bad behavior. This self-correction process, called Reinforcement Learning from AI Feedback (RLAIF), is used to align powerful models, enabling them to refuse harmful requests while explaining their reasoning. The entire system's safety, however, hinges on the quality and completeness of the initial human-written constitution.
ReAct: Teaching LLMs to Think, Then Act
ReAct teaches LLMs to 'think then do,' interleaving reasoning steps with actions like querying a database. Instead of just generating a final answer, the model forms a thought, acts on it, observes the result, and then thinks again. This is crucial for complex question-answering where the model must gather external information to ground its reasoning. The main footgun it avoids is hallucination, where models invent facts instead of looking them up.
Direct Preference Optimization (DPO): Your LLM is a Reward Model
Direct Preference Optimization (DPO) treats your language model as a secret reward model, simplifying alignment with human preferences. Instead of RLHF's complex multi-stage process, DPO directly fine-tunes the model on preference data (e.g., "response A is better than B") using a simple classification loss. This avoids training a separate reward model and the instability of reinforcement learning. The footgun is assuming DPO works without a strong base model and quality preference data.
LoRA: Fine-Tuning LLMs with a Fraction of the Cost
LoRA fine-tunes a massive model by training tiny "adjustment" matrices instead of retraining all its billions of parameters. This allows you to create many specialized versions of a base model like GPT-3 without the prohibitive cost of storing and training full copies. The key advantage is that these adjustments merge into the original weights, so you get specialized models with no added inference latency, a common footgun with other parameter-efficient techniques.