LLM
157 bites tagged LLM — interview questions with model answers, and 60-second explainers.
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.
Mixture of Experts: Scaling LLMs with a Team of Specialists
A Mixture of Experts (MoE) model isn't one giant brain but a team of specialists, routing each task to the most qualified sub-network. This allows large language models to have a massive number of parameters for knowledge, but only activate a small, computationally cheap fraction for any given input. The footgun is mistaking the total parameter count for the active parameters used during inference; MoE models are sparsely activated.
RLHF: Teaching an AI 'Good' Without Code
Reinforcement Learning from Human Feedback (RLHF) teaches a model what humans prefer by having it chase the approval of a proxy 'reward model' trained on human rankings. It's the key technique for making large language models more helpful and harmless by aligning them with nuanced instructions that are hard to define in code. The main footgun is 'reward hacking,' where the model finds loopholes to please the reward model in ways that don't actually satisfy users.
RAG: Giving Language Models an Open-Book Exam
Retrieval-Augmented Generation (RAG) gives a language model an open-book exam instead of forcing it to memorize everything. It combines a model's reasoning ability with a searchable external knowledge base. This grounds LLM responses in specific, up-to-date information, like a support bot using a product manual. The footgun is forgetting that the quality of the retrieved information directly limits the quality of the final answer.
Chain-of-Thought: Making LLMs 'Show Their Work'
Chain-of-thought prompting makes an LLM 'show its work' by generating intermediate reasoning steps before the final answer. This simple few-shot technique dramatically improves performance on complex tasks like math word problems or commonsense questions, especially for very large models. The common footgun is applying it to smaller models, where it can actually degrade performance instead of helping, as the reasoning ability hasn't yet emerged.
Vector Databases: Searching by Meaning, Not Matches
A vector database organizes data by meaning, not just exact values. Instead of finding a record by its ID, you find it by its similarity to a query. This powers AI features like Retrieval-Augmented Generation (RAG), where an LLM finds relevant documents, and recommendation engines. The main footgun is that it finds *approximate* matches, trading perfect accuracy for speed and the ability to search unstructured data.
Attention: Weighing Input by Relative Importance
The attention mechanism lets a model decide which parts of a sequence are most important relative to others. In natural language processing, it assigns 'soft' weights to words, allowing the model to focus on what's most relevant for a given task. It's used to encode sequences of token embeddings, from short phrases to massive documents. The main pitfall is forgetting that these weights are contextual and relative, not absolute measures of a word's importance.
Transformers: Processing Language in Parallel with Attention
Transformers process all input text at once, weighing which words are most important to each other in parallel. This 'attention' mechanism is the core of models like GPT, allowing them to understand context over long sequences. Text is broken into tokens, turned into vectors, and then contextualized by multiple attention 'heads'. The key footgun is that attention alone is order-agnostic; without explicit positional encodings, the model can't distinguish 'dog bites man' from 'man bites dog'.
Prompt Engineering: How to Talk to AIs
Think of prompt engineering as giving a smart but literal intern a precise set of instructions. It's the skill of structuring your text input to guide a generative AI toward a specific, desired output, moving beyond simple keywords. This is essential for getting reliable results, from formatted JSON to correctly styled text. The biggest mistake is treating the AI like a search engine instead of a collaborator that needs clear direction.
Prompt Engineering: Steering AI with Words
Prompt engineering is steering an AI with carefully chosen words instead of code. You use it to get reliable results from chatbots like ChatGPT or to build applications that use large language models (LLMs). The biggest mistake is treating the AI like a search engine; effective prompts provide context, examples, and constraints to guide the model, rather than just asking a simple question.
AI Hallucination: Confabulation, Not Perception
AI hallucination is when a model confidently invents plausible-sounding facts to fill gaps in its knowledge. This isn't a perceptual error but a confabulation—an erroneously constructed response. It occurs when an AI must generate an answer but lacks verifiable data, such as when asked about niche topics. The biggest footgun is trusting an AI's fluent, confident-sounding output without independent verification, as it may be entirely fabricated.
Byte Pair Encoding: Compressing Text for LLMs
Think of Byte Pair Encoding (BPE) as creating custom abbreviations for common letter pairs to compress text. It repeatedly finds the most frequent pair, like 'th', and merges it into a new token. LLMs use this to build vocabularies of common sub-word units, helping them understand rare words. The main footgun is that the final vocabulary size is fixed; choosing the wrong size can hurt model performance and efficiency.
Large Language Models (LLMs)
A large language model is a sophisticated pattern-matching engine trained on a massive library of text. They power modern chatbots and can generate, summarize, or translate text by predicting the most probable next word based on the patterns they've learned. The key footgun is that their output reflects the biases and inaccuracies of their training data, making them confident but potentially unreliable.
Get LLM bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.