AI — Understand the model, then ground it in your own data
The most common job going, and the one with the widest gap between a demo and something you would put in front of a customer. Understand what the model actually is, then learn to feed it your data without it inventing things.
Who this is for: You want to build products on top of LLMs.
3 tracks · 21 hours · one of three paths in the learning roadmap by K Laxman. An optional 4-hour prelude, Just enough to not be bluffing, covers the underlying ideas first.
Track 1 — LLM fundamentals
Understand the thing everything else sits on (~6 hours)
If you only ever do one item on this page, do the first one. Almost every confused conversation I have about AI systems traces back to someone never having watched this.
The whole pipeline, end to end
You can trace a token from raw internet text all the way to a chat reply, naming every stage.
pretraining · tokenisation · transformers · inference · SFT · RLHF · hallucination · tool use · reasoning models
In short:
- Pretraining makes a document completer. Trained to predict the next token over a huge slice of the internet, the base model continues text. It does not follow instructions yet.
- Post-training makes an assistant. Supervised fine-tuning on example conversations, then reinforcement learning from human (or AI) feedback, turns the completer into something that answers.
- Hallucination is the default. The model always produces a fluent continuation. Unless training taught it to recognise what it doesn't know, a confident guess is the most likely text.
- Deep Dive into LLMs like ChatGPT — Andrej Karpathy (video, free, ~3.5h, rated 10/10). Do this first. Nothing else on the internet takes you from raw pretraining data to RLHF and reasoning models in one honest, unhurried pass — including why hallucination happens rather than just that it does.
- Attention Is All You Need — Vaswani et al., 2017 (paper, free, ~1.5h, rated 9/10). Read it AFTER the video, not before. It is eight pages and it will feel obvious, which is exactly the point at which you have understood it.
Build this — Re-implement decoding. Take any provider that returns logprobs and implement greedy, temperature and top-p sampling yourself. Write a README explaining, in your own words, when you'd use each. It is thirty lines of code and it makes §0.5 permanent.
You're done when: You can explain, without notes, why a model hallucinates confidently rather than saying 'I don't know'.
Common traps:
- Treating the model as a database. It stores statistical patterns, not records — look facts up and put them in the context.
- Assuming a reasoning model is always the better choice. It is slower and costlier; many tasks don't need it.
Check yourself:
- Why does a model hallucinate confidently instead of saying "I don't know"? Answer: It was trained to produce likely text, and in its training data questions are usually followed by confident answers. Saying "I don't know" has to be specifically trained in, and it only works for things the model can tell it doesn't know.
- What is the difference between a base model and an assistant model? Answer: The base model continues documents. The assistant is the same network after SFT and RLHF, trained to respond to instructions in a conversation format.
Put to work in: Jarvis — six interchangeable providers behind one loop · CAMSCode — enterprise AI coding assistant
Getting output your code can actually parse
You can make a model return JSON your program can trust, and you know what to do the one call in a thousand where it doesn't.
JSON schema · constrained decoding · refusals · repair passes · streaming partials
In short:
- Ask for a schema, not "JSON please". Provider structured-output modes constrain decoding to your JSON schema, so the reply is valid JSON of the right shape — not just valid-looking text.
- Valid is not correct. The schema guarantees shape. It says nothing about whether the values are true. Validate the business rules in your own code.
- Plan for the one in a thousand. Refusals, truncation at the token limit and schema features the provider doesn't support all still happen. Parse, and on failure repair once or fail cleanly.
- Structured Outputs — OpenAI (docs, free, ~0.5h, rated 8/10). Short, and the only one of these guides that is honest about the failure cases — refusals, and what a schema cannot express. Read it even if you use a different provider; the shape of the problem is the same everywhere.
Build this — A parse-or-repair loop. Ask for a schema, parse the reply, and on a parse failure send the error text back for one repair attempt before giving up. Log how often the repair fires. That number is the difference between a demo and something you can put in front of a customer.
You're done when: You can say what your system does when the model returns prose instead of JSON — and it isn't 'crash'.
Common traps:
- Parsing with a regex over free text. Use the provider's structured mode, and a real JSON parser.
- Setting max tokens too low for the output. A truncated object is invalid JSON, every time.
Check yourself:
- The model returns prose instead of JSON. What does your system do? Answer: Catches the parse error, sends the error text back for one repair attempt, and if that also fails, returns a clear error or fallback — logged and counted.
- The JSON parses and matches the schema. What can still be wrong? Answer: The values. A date can be in the wrong year, a total can fail to add up. Schema validation checks shape; your own checks cover meaning.
Put to work in: CAMSCode — enterprise AI coding assistant · Intelligent document processing
Track 2 — Retrieval-Augmented Generation
The part most people do badly (~10 hours)
Everyone can build a RAG demo in an afternoon. Almost nobody can tell you why theirs returns the wrong chunk. The difference between those two people is this track — and the eval set at the end of it.
RAG properly — all fifteen techniques
You can name, and choose between, the retrieval strategies. Not just 'embed, store, search'.
indexing · retrieval · generation · multi-query · RAG-Fusion · query decomposition · step-back prompting · HyDE · routing · query construction · multi-representation indexing · RAPTOR · ColBERT · CRAG · adaptive RAG
In short:
- Three stages, three failure points. Indexing (split and embed), retrieval (find the right chunks) and generation (answer from them). A wrong answer came from exactly one of them.
- Most techniques fix the query or the index. Multi-query, HyDE, step-back and decomposition rewrite the question; multi-representation indexing and RAPTOR change what gets stored. Each fixes a specific miss.
- Corrective and adaptive RAG add judgement. Grade the retrieved chunks before answering, and re-retrieve or fall back when they are weak, instead of generating from whatever came back.
- Learn RAG From Scratch — LangChain / freeCodeCamp (video, free, ~2.2h, rated 10/10). The reason this beats every 'build a RAG bot in 10 minutes' video is the list of concepts on the left. It goes well past embed-and-retrieve into routing, decomposition, HyDE, RAPTOR and CRAG — the techniques you reach for when the naive version is returning garbage.
- langchain-ai/rag-from-scratch — LangChain (repo, free, ~4h, rated 9/10). Run every notebook. Watching RAG is not learning RAG — the chunking decisions only become real when your own document set makes them go wrong.
Build this — RAG over your own notes — plus a 30-question eval set. The bot is the easy half. The assignment is the eval set: thirty real questions with known answers, and a score you can quote. Without it you have a demo, and you will not be able to tell whether tomorrow's change helped.
You're done when: Given a wrong answer, you can separate retrieval failure from generation failure in under a minute.
Common traps:
- Stacking techniques before measuring. Every one adds latency and cost; add one only when a measured failure calls for it.
- Blaming the model when the right chunk was never retrieved. Look at what was retrieved first.
Check yourself:
- An answer is wrong. What is the one-minute test that tells you where? Answer: Look at the retrieved chunks. If the answer isn't in them, it's a retrieval failure. If it is and the model still got it wrong, it's a generation failure.
- When does HyDE help? Answer: When questions are short and phrased very differently from the documents. Embedding a hypothetical answer lands closer to real answers than the bare question does.
Put to work in: CAMS Lens — SEBI-grounded compliance intelligence · Agentic Research & Decision Intelligence Assistant
Chunking — the decision that quietly decides everything
You can explain why your chunk size is what it is, instead of because a tutorial said 512.
fixed vs semantic splitting · overlap · chunk size vs recall · metadata on the chunk · contextual retrieval
Interactive explainer on the live page: context budget — You can explain why your chunk size is what it is, instead of because a tutorial said 512.
In short:
- The chunk is the unit of retrieval. You can only retrieve what you stored. If the answer is split across two chunks, or buried in a huge one, retrieval can't deliver it cleanly.
- Size is a trade-off. Small chunks match precisely but lose context; large chunks keep context but dilute the embedding. Overlap reduces boundary losses at the cost of duplication.
- Give each chunk its context. Prepending the document title, section heading or a short generated summary (contextual retrieval) makes a chunk findable on its own.
- Introducing Contextual Retrieval — Anthropic (article, free, ~0.75h, rated 9/10). The single change with the best effort-to-payoff ratio in RAG: prepend a sentence of document context to each chunk before embedding it. Measured, with the failure rate reported rather than a vibe. Read this the day your naive retrieval starts missing.
- Chunking Strategies for LLM Applications — Pinecone (article, free, ~0.5h, rated 7/10). Vendor content, and worth it anyway — it is the clearest side-by-side of the splitting strategies. Take the taxonomy, ignore the product.
Build this — Same questions, four chunkings. Take the eval set from the stage above and run it against four indexes: 256 fixed, 512 fixed, 512 with overlap, and semantic. One table, four scores. You will never again accept a chunk size on faith, and you now own a number you can quote in an interview.
You're done when: You can name the chunk size you use, the one you tried before it, and the score difference between them.
Common traps:
- Choosing a chunk size once and never testing it. It is a parameter to measure on your own eval set.
- Splitting through tables and code blocks. Split on the document's own structure — headings, paragraphs, rows — before falling back to character counts.
Check yourself:
- Your chunks say "the policy above applies" and retrieval returns them useless. What is the fix? Answer: Add context to each chunk — document and section titles, or a generated one-line summary — so it stands on its own when retrieved.
- How do you choose between 300-token and 1,000-token chunks? Answer: Index both and run the same questions against each. Compare recall@k and answer quality; pick with numbers, not intuition.
Put to work in: CAMS Lens — SEBI-grounded compliance intelligence
When retrieval is the bug
You can tell a retrieval problem from a generation problem before you touch the prompt.
hybrid search · reranking · recall@k · query rewriting · the missing-document case
In short:
- Measure recall@k first. For a set of questions with known source documents, how often is the right one in the top k results? Until you know that, prompt tweaks are guesses.
- Hybrid search covers both kinds of miss. Keyword search (BM25) catches exact terms and identifiers; vectors catch paraphrase. Combining them fixes misses either one makes alone.
- Rerank a wide net. Retrieve 50 cheaply, then let a cross-encoder reranker pick the best 5. The reranker reads query and chunk together, which is far more precise.
- Rerank — overview — Cohere (docs, free, ~0.5h, rated 8/10). Retrieve twenty, rerank, keep four. It is one extra call and it is the cheapest quality jump available to you — usually larger than swapping the generation model, which is where people reach first.
Build this — Measure recall@k before you tune anything. For each question in your eval set, record whether the answer-bearing chunk appeared in the top k at all. If it didn't, no prompt on earth was going to save that answer. Split your failures into 'never retrieved' and 'retrieved and ignored' — they have completely different fixes.
You're done when: You have a recall@k number for your own corpus, and you fixed retrieval before you touched the prompt.
Common traps:
- Tuning the prompt to fix answers whose source was never retrieved.
- Not handling the missing-document case. When nothing relevant exists, the system should say so, not answer from the nearest irrelevant chunk.
Check yourself:
- Users search for error code "E4031" and get nothing useful. Why, and what fixes it? Answer: Embeddings don't represent exact identifiers well. Add keyword search (hybrid) so exact matches get found.
- Recall@5 is 60% but recall@50 is 95%. What do you add? Answer: A reranker. The right documents are being found; they just aren't ranked high enough. Rerank the top 50 down to 5.
Put to work in: CAMS Lens — SEBI-grounded compliance intelligence · Agentic Research & Decision Intelligence Assistant
Track 4 — Evals, tracing & observability
The stage everyone skips (~5 hours)
This is the one that separates a demo from a product. As a system gets complicated, evals and tracing stop being nice-to-have and become the only way you can change anything without breaking it. If you cannot state your system's accuracy as a number with a dataset behind it, you do not have a system — you have a vibe.
Dataset → evaluator → task → interpretation
You can build an evaluation harness before you build the feature.
datasets · evaluators · LLM-as-judge and its failure modes · tracing · regression detection
In short:
- An eval is a dataset plus a grader. Inputs with expected outputs or criteria, run through your system, scored the same way every time. Without one, every change is a guess.
- Start small and real. Thirty real questions with checked answers beat a thousand synthetic ones. Add every production failure to the set as you find it.
- Trace everything. Record each run's prompts, retrieved chunks, tool calls and outputs. When a score drops, the trace shows which step changed.
- Why Evals Matter — LangSmith Evaluations, Part 1 — LangChain (video, free, ~0.4h, rated 10/10). Four pieces — dataset, evaluator, task, interpreting the result — and once you have that frame, every other eval tool is just an implementation of it. Part 1 is mandatory; carry on through the series as far as your patience holds.
- Demystifying evals for AI agents — Anthropic (article, free, ~0.3h, rated 9/10). The vocabulary for evaluating agents rather than single answers: tasks and trials, code-based, model-based and human graders, transcripts versus final outcomes, and the difference between pass@k (succeeds at least once) and pass^k (succeeds every time) — the one production cares about.
Build this — Put a number on the RAG bot. Add the eval set and tracing to what you built in Track 2. Report the score in the README. Then change the chunk size and report it again — that delta is the whole discipline.
You're done when: You can say what your system's accuracy is, with a number and a dataset behind it.
Common traps:
- Judging a change by trying five prompts by hand. You will remember the wins and forget the regressions.
- Only measuring the final answer in a multi-step system. Score the retrieval and tool steps too, or you can't tell where it broke.
Check yourself:
- "The new prompt feels better." What do you ask for? Answer: The score on the eval set before and after, on the same data, and the examples that got worse.
- Where should new eval examples come from once you're live? Answer: Production failures — user reports, low ratings and traced errors — added to the dataset so they can't regress silently.
Put to work in: CAMS Lens — grounded answers that have to be right
LLM-as-judge — and where it stops being trustworthy
You can grade an open-ended answer automatically, and you know which of those grades to disbelieve.
pairwise vs pointwise · position bias · agreement with humans · error analysis · when to just read the outputs
In short:
- A judge is a model you must evaluate. Label a sample yourself and measure how often the judge agrees. Until you have that number, the judge's scores are unverified.
- Pairwise is steadier than pointwise. "Which of these two is better?" is more reliable than "rate this 1–10". Swap the order and check again to cancel position bias.
- Binary criteria beat vague scales. "Does the answer cite a source from the context? yes/no" is far easier to judge consistently than "rate helpfulness".
- Creating a LLM-as-a-Judge That Drives Business Results — Hamel Husain (article, free, ~1h, rated 10/10). The correction to everything else written on this subject. The judge is not the work — aligning the judge with a human who actually looked at the data is the work, and most teams skip straight past it and then trust a number that means nothing.
- Evaluation concepts — LangSmith (docs, free, ~0.5h, rated 8/10). The reference to keep open while you wire it up — the vocabulary the video introduces, written down where you can search it.
Build this — Grade your judge. Hand-label thirty of your own outputs. Have the judge label the same thirty. Report the agreement rate. Below about 80% the judge is telling you a story, and you have just learned that for the price of an afternoon.
You're done when: You can quote the agreement rate between your judge and your own labels — and you know which failure category it gets wrong.
Common traps:
- Judges favour longer answers, the first option shown and outputs from their own model family. Control for each.
- Using a judge for facts it can't check. Give it the reference answer or the source context.
Check yourself:
- How do you know your judge is trustworthy? Answer: Hand-label 50–100 examples and measure agreement with the judge. Then read the disagreements to see which failure type it misses.
- What is position bias, and how do you control it? Answer: The judge prefers whichever answer it sees first (or second). Run each pair in both orders and only count consistent verdicts.
Put to work in: CAMS Lens — grounded answers that have to be right
Explore more
- Home — overview, skills and a built-in AI assistant
- Experience — roles at Think360 AI (CAMS), CAMS Mutual Funds and IIT Delhi
- Projects — GenAI, LLM, RAG and full-stack builds
- Education — IIT Delhi, M.Tech & B.Tech Computer Science
- Learn — a working AI engineer's roadmap: LLMs, RAG, agents, evals, production
- GitHub Activity — open-source contributions
- Contact / Hire me