Generative AI Roadmap: A Step-by-Step Learning Path
Learn in the order you will build: use a model, ground it in data, connect it to tools, then make it measurable and maintainable.
A practical Generative AI roadmap moves through six stages: programming foundations, machine-learning basics, how large language models work, prompting, retrieval-augmented generation, and agents with evaluation and deployment. Beginners start at stage 1, developers with Python experience can usually start at stage 3, and advanced learners focus on stages 5–6. Finish each stage with a small project and a test set so that every new concept is checked in practice.
How to use this roadmap
The stages are ordered the way applied work is built: first you can call a model and handle its output, then you understand why it behaves as it does, then you ground it in your own data, and finally you connect it to tools and run it reliably. Skipping ahead is possible, but most problems people meet in later stages trace back to a gap in an earlier one.
Each stage below lists what to learn, a short code example, a project to finish it and a checkpoint that tells you when you are ready to move on. Pick your starting point from the table, and be honest: going back one stage costs less than building on a weak foundation.
| Level | You can already | Start at |
|---|---|---|
| Beginner | Use a computer confidently; little or no programming | Stage 1: Python, APIs and data handling |
| Intermediate | Write Python, use Git and call an API from documentation | Stage 3: how LLMs work, after a quick check of stage 2 |
| Advanced | Build and deploy applications and write automated tests | Stage 5: retrieval, then agents and operations |
The roadmap at a glance
| Stage | Learn | Finish with |
|---|---|---|
| 1. Foundations | Python, APIs, JSON, Git and basic data handling | A script that calls an API and validates the response |
| 2. ML basics | Training versus testing, overfitting and evaluation metrics | A simple classifier with an honest evaluation |
| 3. How LLMs work | Tokens, embeddings, attention, context and sampling | A short explainer in your own words, with experiments |
| 4. Prompting | Instructions, examples, output formats and test sets | A prompt with a versioned test suite |
| 5. Retrieval (RAG) | Chunking, embeddings, vector search and grounded answers | Question answering over a document set, with measured retrieval |
| 6. Agents and operations | Tool use, evaluation, tracing, cost and security | A deployed application with monitoring and regression tests |
Stage 1 (beginner): Python, APIs and data
Python is the common language of Generative AI work because most model SDKs, data tools and examples use it. Focus on the parts you will use every day: functions, lists and dictionaries, loops, error handling, reading and writing files, and calling HTTP APIs. You do not need advanced language features before moving on.
Learn JSON well, because models are usually asked to return it and it is often slightly wrong. Learn Git so that you can track changes to code and prompts, and learn to keep API keys in environment variables rather than in code. Virtual environments and a requirements file make your work reproducible on another machine.
The example below shows the habit that matters most in this stage: never trust output until code has checked it. It parses a model’s reply and rejects it if it is not a JSON object with the required fields.
- Project: a script that sends a short article to a model API, asks for a title, summary and tags as JSON, validates the reply and saves valid results to a file.
- Checkpoint: you can explain each line of your script, handle a failed request without crashing and recreate the environment from your requirements file.
import json
REQUIRED = {"title", "summary", "tags"}
def parse_result(text: str) -> dict | None:
"""Return the parsed result, or None if it is not usable."""
try:
data = json.loads(text)
except json.JSONDecodeError as err:
print("Not valid JSON:", err.msg)
return None
if not isinstance(data, dict):
print("Expected a JSON object")
return None
missing = REQUIRED - data.keys()
if missing:
print("Missing fields:", sorted(missing))
return None
return dataSources: Python tutorial: functions and control flow; Python tutorial: data structures. Checked 23 October 2026.
Stage 2 (beginner): Machine-learning basics
You can build Generative AI applications without training models, but you cannot build good ones without evaluation habits, and machine learning is where those habits are taught. Learn the difference between training and test data, what overfitting looks like, and why a single accuracy figure can hide poor performance on the cases that matter.
Data leakage is the most important idea in this stage. If information from the test set influences training, for example by scaling all data before splitting it, the score looks better than the model really is. The same mistake appears later when people tune prompts on the very examples they report results on.
The example trains a simple classifier with scikit-learn. Scaling sits inside the pipeline, so it learns only from training data, and the report shows precision and recall for each class rather than one headline number.
- Project: a classifier on a public dataset, with a held-out test set, cross-validation and a short note on which errors would be most costly in practice.
- Checkpoint: you can explain overfitting, leakage, precision and recall to a friend without notes, and say which metric you would choose for a given decision.
from sklearn.datasets import load_breast_cancer
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import classification_report
from sklearn.model_selection import train_test_split
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.25, stratify=y, random_state=42
)
# Scaling lives inside the pipeline, so it learns only from training data.
model = make_pipeline(StandardScaler(), LogisticRegression(max_iter=1000))
model.fit(X_train, y_train)
print(classification_report(y_test, model.predict(X_test)))Sources: scikit-learn: leakage and common pitfalls; scikit-learn: cross-validation; scikit-learn: model evaluation metrics. Checked 23 October 2026.
Stage 3 (intermediate): How large language models work
A large language model reads text as tokens, which are words or pieces of words, and predicts the next token repeatedly. Tokens are turned into embeddings, vectors that place related meanings near each other, and the transformer’s attention mechanism lets each position weigh every other position in the context when making a prediction.
This explains most practical behaviour. The context window limits how much text the model can consider at once, and both cost and latency usually grow with the number of tokens. Sampling settings such as temperature control how much the output varies between runs. Because the model predicts plausible text rather than looking up facts, it can produce fluent answers that nothing supports, which is why later stages add retrieval and evaluation.
You do not need to implement a transformer to do applied work, but you should be able to reason with these ideas when a model misbehaves.
- Project: a short written explainer, in your own words, of tokens, embeddings, attention, context windows and sampling, illustrated with the results of the three experiments.
- Checkpoint: you can explain why a model might invent a citation and name two ways to reduce the risk.
Experiment 1: count tokens
Use a tokenizer for the model you are learning with and count tokens for the same paragraph in English, in Hindi or Telugu, and as code. Note how the counts differ and what that means for cost and context limits.
Experiment 2: vary temperature
Run the same prompt ten times at a low and a high temperature. Compare how often the answers differ and which setting suits extraction tasks versus brainstorming.
Experiment 3: provoke an unsupported answer
Ask about a fictional company or a very recent event, then ask again with a short document that contains the answer. Record how the reply changes when evidence is provided.
Sources: Vaswani et al.: Attention Is All You Need. Checked 23 October 2026.
Stage 4 (intermediate): Prompting as specification
Treat a prompt as a specification for a task: state the goal and audience, provide the context the model needs, give examples of good outputs, set the output format and say what to do when information is missing. Clear, specific instructions usually help more than clever wording.
The skill that separates professional work from experimentation is testing. Build a set of twenty to fifty representative inputs, including awkward ones, decide how each output will be checked, and run the whole set every time you change the prompt or model. Keep prompts in version control and record what each change improved or broke.
The runner below scores one prompt version against a set of cases. Each case carries its own check, which can be a schema validation, a keyword test or a comparison with a known answer.
- Project: a prompt for a real task, such as classifying support messages into your own categories, with a versioned test suite and a table comparing at least three prompt versions.
- Checkpoint: you can show, with numbers from your test set, why your current prompt is better than the first version.
def run_suite(cases, generate, prompt_version):
"""cases: list of dicts with an "input" and a "check" function."""
passed = 0
for case in cases:
output = generate(case["input"])
ok = case["check"](output)
passed += ok
if not ok:
print(f"[{prompt_version}] failed:", case["input"][:60])
print(f"[{prompt_version}] {passed}/{len(cases)} passed")
return passed / len(cases)Sources: Anthropic: prompt engineering overview. Checked 23 October 2026.
Stage 5 (intermediate to advanced): Retrieval-augmented generation
Retrieval-augmented generation (RAG) lets a model answer from documents it was not trained on. Documents are split into chunks, each chunk is converted to an embedding and stored in an index, and at question time the closest chunks are retrieved and placed in the prompt with instructions to answer only from them and to cite them.
Most RAG failures are retrieval failures. If the right chunk is not retrieved, even a strong model cannot answer correctly, so measure retrieval separately: for each test question, record which chunk contains the answer and check whether it appears in the top results. Then measure whether answers are supported by the retrieved text and whether the system declines questions the documents cannot answer.
Advanced learners should compare chunking strategies, combine keyword and vector search, add a reranking step and track how each change affects both retrieval hit rate and answer quality. The function below shows the core of vector search: rank chunks by cosine similarity to the question.
- Project: question answering over a public document set, such as an open-source project’s documentation, with about thirty test questions, some of them unanswerable, and separate scores for retrieval and answers.
- Checkpoint: when an answer is wrong, you can tell from your logs whether retrieval, the prompt or the model was responsible.
import numpy as np
def top_k(query_vec, chunk_vecs, chunk_ids, k=5):
"""Return ids of the k chunks most similar to the query (cosine similarity)."""
q = query_vec / np.linalg.norm(query_vec)
m = chunk_vecs / np.linalg.norm(chunk_vecs, axis=1, keepdims=True)
scores = m @ q
best = np.argsort(scores)[::-1][:k]
return [chunk_ids[i] for i in best]Sources: Lewis et al.: Retrieval-Augmented Generation. Checked 23 October 2026.
Stage 6 (advanced): Agents, evaluation and operations
An agent lets the model choose actions, such as searching, calling an API or writing a file, and repeat until a task is done. Give it the fewest tools that do the job, limit the number of steps, require human approval for actions that change data or spend money, and log every tool call with its arguments and result. An agent without logs cannot be debugged.
Operating any Generative AI application means tracing requests, tracking cost and latency, and running your test set automatically before every change to prompts, models or retrieval settings. Model providers update models, so record the exact model version alongside each result.
Security belongs in this stage, not after it. Prompt injection, where instructions hidden in a document or web page redirect the model, is the risk most specific to these systems. Treat retrieved content and tool output as untrusted data, keep secrets out of prompts and restrict what each tool can access. Risk-management frameworks help teams decide which risks to accept and how to monitor them.
- Project: deploy your stage 5 application behind a small web interface, with tracing, versioned prompts, a regression test that blocks deployment when scores drop, and one agent feature that uses a tool with approval.
- Checkpoint: you can show a log or dashboard of cost, latency and quality over time, and explain how your system resists a prompt-injection attempt.
MAX_STEPS = 8
WRITE_TOOLS = {"create_ticket"}
def run_agent(task, decide, tools, approve, log):
history = [task]
for step in range(MAX_STEPS):
action = decide(history) # the model picks a tool call or a final answer
if action["type"] == "final":
return action["text"]
name, args = action["tool"], action["args"]
if name not in tools:
history.append(f"Unknown tool: {name}")
continue
if name in WRITE_TOOLS and not approve(name, args):
history.append(f"{name} was not approved")
continue
result = tools[name](**args)
log(step=step, tool=name, args=args, result=result)
history.append(result)
return "Stopped: step limit reached"Sources: OWASP: Top 10 for LLM Applications; NIST: AI Risk Management Framework; Google Cloud: MLOps delivery and automation; MLflow: experiment tracking. Checked 23 October 2026.
Adjust the roadmap to your background
The six stages are the same for everyone, but where you spend your time depends on what you already know and the role you want.
| Background | Move quickly through | Spend extra time on |
|---|---|---|
| New to programming | Nothing; take stage 1 slowly | Python, debugging and reading documentation |
| Software developer | Stage 1 | Stages 2 and 4: evaluation habits and test sets |
| Data analyst or ML practitioner | Stages 1–2 | Stages 5–6: retrieval, application code and deployment |
| Business or product role | Code depth in stages 5–6 | Stages 3–4: model behaviour, prompting and evaluating outputs |
An example pace for part-time learners
The plan below is one example for someone studying about eight to ten hours a week from stage 1. Time required varies widely with background and weekly hours, so treat it as a sequence rather than a deadline.
- Weeks 1–4: stage 1, ending with the validated API script.
- Weeks 5–7: stage 2, ending with an honestly evaluated classifier.
- Weeks 8–9: stage 3 experiments and your written explainer.
- Weeks 10–12: stage 4, ending with a prompt and its test suite.
- Weeks 13–17: stage 5, ending with measured question answering over documents.
- Weeks 18–24: stage 6, ending with a deployed, monitored application.
Common mistakes on the way
- Collecting courses and tutorials instead of finishing projects.
- Skipping evaluation, so there is no evidence that anything works beyond a demo.
- Jumping to agents before you can build and measure a reliable single model call.
- Adopting a framework before understanding the steps it hides.
- Relying on old tutorials when model APIs and libraries change often; check official documentation.
- Committing API keys or using data you do not have permission to use.
Common questions
Where should I start learning Generative AI?
Start with Python and calling a model API, then learn how LLMs work and how to write and test prompts. Add retrieval and agents once those basics are comfortable.
Do I need machine learning before Generative AI?
Basic ML concepts, especially evaluation and overfitting, are very useful. You can build applications without training models, but you still need to measure whether they work.
Do I need advanced mathematics?
Not for applied work. Comfort with basic statistics and the idea of vectors helps with evaluation and embeddings. Research roles and training models from scratch need much more.
Can a non-programmer follow this roadmap?
Yes, by starting with stage 1. Some roles use AI tools without coding, but building applications requires programming skills.
How long does it take to learn Generative AI?
It depends on your background and weekly hours. A part-time learner starting from scratch might take around six months to complete all six stages with projects; experienced developers often move faster.
Should I get a certification?
A certification can structure your study and signal knowledge of a specific cloud platform, but projects with measured results are usually stronger evidence of practical skill.

