tezvyn:

LLMs & Generative AI

Large language models, chatbots, agents, prompt engineering

324 bites

More in LLMs & Generative AI — page 8

LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

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.

LLMs & Generative AI2 min read

AWS Inferentia and Annapurna Labs

AWS Inferentia is an AWS chip product line. Annapurna Labs, Amazon's semiconductor division acquired in 2015, builds Nitro, Graviton, and Trainium and ranks among TSMC's top five fabless customers. Do not assume Annapurna designs every AWS accelerator.

Google TPU: Built for Matrix Math
LLMs & Generative AI2 min read

Google TPU: Built for Matrix Math

A TPU is a specialist ASIC, not a faster GPU; it trades graphics flexibility for matrix-math throughput per watt. Google deploys them for TensorFlow, JAX, and PyTorch at scale. They excel at CNNs but can lag on tasks needing rasterization or recurrent logic.

LLMs & Generative AI2 min read

Few-Shot Prompting

Few-shot prompting embeds task examples directly in the prompt to guide output format without retraining. It excels at niche tasks and consistent formatting, but mismatched examples degrade performance more than no examples at all.

LLMs & Generative AI2 min read

LLM Scaling Laws: Match Parameters to Tokens

For a fixed compute budget, model size and training data must grow equally. When choosing between a larger model or more tokens for the same FLOPs, more data usually wins. The footgun is scaling parameters alone, which undertrains the model and wastes compute.

Open LLM Leaderboard: Separating Hype from Performance
LLMs & Generative AI2 min read

Open LLM Leaderboard: Separating Hype from Performance

The Open LLM Leaderboard is the de facto scoreboard for open-source models, providing reproducible benchmarks to cut through marketing hype. It helps you compare models on standardized tests, but remember that a high rank doesn't guarantee performance on your…

LLMs & Generative AI2 min read

AI Coding Assistants: Your LLM Pair Programmer

AI coding assistants are like pair programmers powered by large language models. They assist in tasks across the software lifecycle, from code generation and testing to debugging and documentation. The key footgun is over-reliance; they assist, not replace.

LLMs & Generative AI2 min read

AI's Dual-Use Problem: Good Tools, Bad Outcomes

AI models built for good can be easily repurposed for harm. A language model that helps with coding can also generate malware. The footgun is assuming good intentions prevent misuse; the risk is in the capability, not the creator's intent.

LLMs & Generative AI2 min read

Quantization-Aware Training (QAT): Forcing Models to Learn While Quantized

QAT forces a model to "learn its own compression" by simulating quantization during training. This lets you shrink LLMs to aggressive low-bit formats (like 4-bit) where simpler post-training methods fail.

Dynamic Batching: Balancing LLM Throughput and Latency
LLMs & Generative AI2 min read

Dynamic Batching: Balancing LLM Throughput and Latency

Dynamic batching groups LLM requests like a bus that leaves on a schedule or when full, whichever comes first. This improves throughput in inference servers by avoiding long waits. The footgun: all requests in a batch are still held hostage by the slowest one.

Model Pruning: Making LLMs Smaller, Not Dumber
LLMs & Generative AI2 min read

Model Pruning: Making LLMs Smaller, Not Dumber

Model pruning is surgical weight loss for an LLM, removing neurons or layers to reduce its size. It's used to create smaller, faster versions of models like LLaMA for efficient deployment. The footgun: naive pruning can cripple the model's core capabilities.

Modality Gap: When Multimodal LLMs Don't Trust Their Senses
LLMs & Generative AI2 min read

Modality Gap: When Multimodal LLMs Don't Trust Their Senses

A multimodal LLM has a modality gap when it trusts one input type (like text) over another (like images), even with identical information. This bias causes performance drops, like ignoring visual data if conflicting text is present.

Full Fine-Tuning: Updating Every Model Parameter
LLMs & Generative AI2 min read

Full Fine-Tuning: Updating Every Model Parameter

Full fine-tuning updates all weights of a pre-trained model on your new data, unlike methods that only change a small fraction. Use it to deeply embed new knowledge, but beware: it's costly and risks making the model forget its original general skills.

LLMs & Generative AI2 min read

LLMs as Tool Makers: Write Once, Solve Many

LLMs can create their own tools, not just use them. A powerful model writes a reusable function once, and a cheaper model calls it many times. This gives top-tier results at a lower cost for repetitive tasks.

LLMs & Generative AI2 min read

Reflection: Teaching LLM Agents to Learn from Mistakes

Reflection gives an agent an "inner monologue" to learn from its mistakes. An Actor model attempts a task, an Evaluator scores it, and a Self-Reflection model generates linguistic feedback for the next try.

LLMs & Generative AI2 min read

LangChain Agents: Giving LLMs a Toolkit

A LangChain Agent is an LLM given a toolkit and a goal. The agent's 'harness' prompts the model to pick tools, call them in a loop, and reason about the results until the task is complete. Use it to query databases or call external APIs.