A reader asks:
“Hi Neo, do I really need to understand all these AI concepts? RLHF, vector search, quantization, diffusion models, MCP, hybrid retrieval... It feels like every time I learn one concept, five more appear. Lol”
All I will say is this:
You don’t need to master every AI concept to start building AI apps.
At least, not all at once.
But understanding how these concepts work makes a BIG difference.
Onward.
§
Same model, 2x the fixes: the coding harness is part of the system
Most teams choose a coding agent by its model. AgentField tested the other half: ten coding harnesses on one open model, run on the same 113 real GitHub issues from the DeepSWE benchmark. Results ran from 3 solved issues to 62. The system around the model decides as much as the model does.
CodeAF, a new open-source coding harness by AgentField AI, finished #1 of the ten (method and data are public on GitHub):
2x OpenCode’s solves and nearly 4x Claude Code’s, on the same model
4.8x less per solved issue than OpenCode, 3.4x less than Claude Code
Built for open models like DeepSeek, Qwen, GLM and Kimi, and it works with closed models too
One small Go binary, open source
(Thanks to AgentField for partnering on this newsletter.)
§
Share this letter & I’ll send you some rewards for the referrals.
§
This is part 2 of a four-part1 newsletter series:
Reinforcement Learning from Human Feedback,
Pretraining,
Vector Search and Approximate Nearest Neighbors,
In-Context Learning,
Hallucination, Factuality and Grounding,
Quantization,
Context Windows and Long-Context Modeling,
Structured Outputs and Constrained Decoding,
Model Context Protocol,
Parameter-Efficient Fine-Tuning,
Diffusion Models,
Autoregressive Generation and Next-Token Prediction,
Self-Supervised Learning,
Inference,
Retrieval Reranking,
Hybrid Retrieval,
Chunking and Document Segmentation.
( …and much more in Parts 3 & 4!)
For each, I’ll share:
What it means & how it works,
A real-world analogy where useful,
A common mistake to avoid,
Why it matters.
Let’s dive in!
§
18. Reinforcement Learning from Human Feedback
Reinforcement Learning from Human Feedback (RLHF) uses human feedback to guide further model training toward preferred responses.
Give reviewers two answers to the same question.
The reviewers compare qualities such as usefulness & how well each answer follows instructions. Those comparisons train a reward model2 to score responses. The language model then receives further training to produce responses with higher scores.
Human preferences help shape what the training process rewards.
This improves behavior according to the chosen criteria, but still needs careful evaluation.
Analogy
Think of a coach reviewing practice performances:
Feedback guides the next attempt. The improvement depends partly on whether the coach rewards the qualities the task actually requires.
Common mistake
Confusing a preferred answer with a “verified” answer.
Reviewers could favor a polished response containing a subtle factual error. Check accuracy separately from tone & helpfulness.
Why it matters
RLHF helps shape a broadly trained model into a more useful assistant. The feedback criteria influence which behaviors the model learns to favor.
19. Pretraining
Pretraining is an initial training stage in which a model learns broad patterns from a large dataset before more specialized training.
Before a model follows your request, it needs a foundation.
For a typical generative language model, pretraining repeatedly tests predictions of the next token3. Prediction errors guide adjustments to the model’s weights. Across many examples, these adjustments help the model learn patterns in the text.
The text itself supplies the next-token answers.
Other models use different tasks, such as predicting missing pieces of an input.
Analogy
Think of a broad education before a specialized course:
The foundation covers many subjects & patterns. Later instruction directs those abilities toward a particular role.
Common mistake
Assuming pretraining produces a ready-to-use assistant.
A model trained to predict text doesn’t automatically respond in the style users expect. Further training & application design help shape how it handles requests.
Why it matters
Pretraining provides capabilities reused across many tasks.
The data influences what the model learns well and where its knowledge has gaps.
20. Vector Search and Approximate Nearest Neighbors
Vector search finds items with similar numerical representations. Approximate Nearest Neighbors (ANN) methods speed up search while accepting the possibility of missing some closest matches.
Imagine searching millions of support documents:
The system converts your question into an embedding4 & compares it with document embeddings with vector search. An exact search finds the closest matches under a chosen comparison rule. An approximate search uses an index, an organized search structure, to reduce the work.
The shortcut helps results arrive faster.
How much accuracy it sacrifices depends on the method & its settings…
Analogy
Think of a librarian directing you to likely shelves…
You search a smaller area instead of checking every book. The shortcut saves time, but you could miss a useful book elsewhere.
Common mistake
Choosing the fastest setup without checking its results.
A quick search is unhelpful if it repeatedly misses the relevant document. Compare retrieval quality, response time & memory use.
Why it matters
Vector Search: Best for smaller datasets requiring the true nearest matches.
Approximate Nearest Neighbors: Best for large datasets where search speed & scalability matter more than finding the exact nearest match.
§
§
21. In-Context Learning
In-context learning is a model’s ability to use instructions/examples in its current context without updating its weights.
Show the model a few examples before asking it to label a new message:
“My card was charged twice” → Billing
“The page crashes when I sign in” → Technical
The examples demonstrate the categories & response format. The model then uses the pattern to label the next message. No separate training run occurs!
The examples guide the response through the context.
(Remove them from a later request, and you shouldn’t assume the model still has access to them.)
Analogy
Think of filling out a form after examining a completed sample:
The sample shows how the fields work. You apply the pattern immediately without taking a new course.
Common mistake
Providing examples that cover only obvious cases.
If every billing example contains “invoice,” the model could rely too heavily on a specific word. Include varied wording & difficult cases, then test on separate examples.
Why it matters
In-context learning lets you demonstrate a task quickly. It helps you test formats/categories before investing in fine-tuning.
22. Hallucination, Factuality, and Grounded Answers
A hallucination is generated content presented as “true” despite being false/unsupported. Factuality concerns correctness; grounding connects an answer to evidence.
An assistant gives you a confident answer & 3 citations.
One source doesn’t exist. Another exists without supporting the claim. The answer looks well researched, but its appearance tells you little about its accuracy.
The evidence needs inspection too…
A grounded answer uses supplied or retrieved material. It could still repeat an error from an outdated source, so the material's quality matters.
Analogy
Think of a report with footnotes.
The footnotes help you trace the claims. You still need to check whether the sources exist & support what the report says.
Common mistake
Treating a citation as a completed fact-check.
Check the source & compare its content with the answer. Give the system a way to report insufficient evidence instead of filling gaps with guesses.
Why it matters
These distinctions help you find the source of an error. The application could need better documents, better retrieval, and/or stricter checks on the final answer.
23. Quantization
Quantization stores model values using fewer bits, thus reducing memory needs while preserving less numerical details.
A model is too large for your machine's memory.
Its weights are numbers, and storing those numbers takes space. Quantization converts selected values into smaller numerical representations. The model needs less memory, though the conversion introduces approximations.
You trade some precision for a smaller memory footprint.
The effect on output quality depends on the model & the quantization method.
Analogy
Think of recording measurements to the nearest centimeter instead of millimeters.
You preserve less detail. Whether the difference matters depends on what you need the measurements for.
Common mistake
Assuming a smaller model representation always runs faster with identical results.
Speed depends on the hardware & software used to run it. Test both quality and response time before choosing a quantized version.
Why it matters
Quantization helps larger models fit within smaller memory budgets. It creates more deployment options when the quality tradeoff is acceptable.
24. Context Windows and Long-Context Models
A context window is the amount of information a model handles within a single context (measured in tokens). Long-context models support larger amounts of material.
Upload a long manual & ask about a detail halfway through it.
Your instructions, conversation history, document text, and tool results all take up space. In typical text-generation systems, the response also needs room within the overall limit. The application decides what to include & how much space to reserve for the answer.
A larger window holds more material.
Yet it doesn’t guarantee the model uses every detail correctly.
Analogy
Think of a desk covered with reference pages.
A larger desk holds more pages. It doesn’t guarantee you notice every detail or connect the right passages.
Common mistake
Assuming a document that fits is a document the model uses reliably.
Test questions whose answers appear in different parts of the document. Remove irrelevant material or retrieve targeted passages when full-document answers become unreliable.
Why it matters
Context limits affect document analysis, code review & long conversations. Plus the amount of material processed influences cost & response time.
25. Structured Outputs and Constrained Decoding
Structured outputs follow a specified format. Constrained decoding5 restricts what model generates, so the output follows supported format rules.
Your application needs 3 fields from a support ticket.
A paragraph is inconvenient for code to process. A schema, or set of format rules, defines the field names, value types, and permitted choices. Constrained decoding limits the model’s next-token options to keep the response within those rules.
This makes the result easier for software to process.
For example, a structured output could follow a JSON schema like this
{
“category”: “billing”,
“priority”: “high”,
“order_id”: null
}Analogy
Think of a form with fixed fields & dropdown menus.
The form controls where information goes & which options are allowed. It doesn’t establish whether the selected option is correct.
Common mistake
Confusing correct format with correct information.
A response could follow every format rule and still misclassify a ticket. Check the values and handle refusals or incomplete responses separately.
Why it matters
Structured outputs reduce work needed to turn model responses into usable application data. They solve a formatting problem, while factual checks remain necessary.
26. Model Context Protocol
Model Context Protocol (MCP) is an open standard for connecting AI apps to external tools & information sources.
Your assistant needs access to a document store & a ticket system.
An MCP server exposes capabilities, such as a document search or ticket lookup. The AI application connects through an MCP client, which discovers those capabilities and exchanges requests & results. The shared protocol gives both sides a common way to communicate.
The connection follows a standard format.
(The application & connected services still need to enforce access permissions.)
Analogy
Think of a standard connector between devices:
A shared connector reduces custom wiring. Each device still offers different capabilities & plugging it in doesn’t grant permission to use everything.
Common mistake
Treating an MCP server as automatically trusted.
A server could expose sensitive data or powerful actions. Review its capabilities, limit permissions & decide which actions need approval.
Why it matters
MCP reduces custom integration work across compatible AI applications.
A server’s capabilities become reusable without designing a different communication interface for every application.
27. Parameter-Efficient Fine-Tuning and LoRA
Parameter-Efficient Fine-Tuning (PEFT) adapts a model by training only a small portion of its parameters or added parameters. Low-Rank Adaptation (LoRA) is one method that learns compact additions to selected model weights.
You want a model to follow your support team’s response style.
Full fine-tuning updates all of the model’s weights. LoRA keeps the original weights fixed and trains smaller groups of numbers that represent changes to selected layers. These learned additions influence the model’s output.
The additions are then saved as an adapter6.
The adapter works alongside the base model, or its changes are merged into compatible weights.
Analogy
Think of a company handbook with a short supplement for each department:
The main handbook stays the same. Each supplement adapts to a specific role. A LoRA adapter serves a similar purpose through learned numerical changes.
Common mistake
Assuming a small adapter works with any model.
Its changes depend on the base model & layers used during training. Keep the matching model version and configuration, then test the combined result on separate examples.
Why it matters
PEFT reduces the resources needed to train and store specialized adaptations.
The base model still needs memory and computation, but maintaining several task-specific versions becomes more practical.
§
Reminder: this is a teaser of the subscriber-only newsletter, exclusive to my golden members.
When you upgrade, you’ll get:
High-level architecture of real-world systems.
Deep dive into how popular real-world systems work.
How real-world systems handle scale, reliability & performance.
(If this newsletter has helped you become a better software engineer, consider subscribing to support my work.)












