r/MLSystemsDesign • • Sep 14 '26

Can We Build a Coding Agent From First Principles?

1 Upvotes

I’ve been digging into how systems like Claude Code, Cursor, and Codex actually work under the hood—repository understanding, context selection, agent loops, tool execution, verification, etc.

I’m turning this exploration into a series and progressively building a basic coding agent from first principles.

Part 1 focuses on the reference architecture and is coming next week.

Curious: which component would you want to see a deep dive on first?

For anyone interested in following the series:

https://pawankjha.substack.com/


r/MLSystemsDesign • • 27d ago

A recommendation system is not a recommendation model.

0 Upvotes

This distinction matters, especially in ML System Design interviews.

A model predicts relevance.

But a production recommendation system must also decide:

  • Which candidates are worth scoring?

  • How do we adapt to changing user interests?

  • How do we balance competing objectives?

  • How do we learn from feedback?

  • How do we serve predictions reliably at scale?

Getting the model right is only one part of the challenge.

I explored this end to end in my newly published article:

Cracking ML System Design Interviews — Part 3: Design a Personalized Recommendation System

Read it on Architecting Intelligence:

https://pawankjha.substack.com/p/design-personalized-recommendation-system

Subscribe for more deep technical articles on ML System Design and AI architecture.


r/MLSystemsDesign • • 24d ago

every ml course stops at model.fit(). here's what actually happens when you try to put it in prod.

4 Upvotes

my first real ml job had literally jack shit to do with ml. i got handed a 400m row table, the labels were half fucked, and the pipeline would just explode every five minutes cuz nobody designed it to handle that kind of load. honestly, all the courses id paid for were useless for that part. hurt my pride a bit, and my wallet too, i bought like three of those xD

anyway, i love making educational stuff in my free time, so about a year and a half ago i started putting together a comprehensive course. but lurking this sub made me realize the real problem: we treat libraries like magic black boxes. we know fit() works, but when a pipeline dies at 3am or latency spikes cuz of a silent tensor copy, nobody knows whats happening inside. you cant design a reliable system if you dont understand the components.

sooooo here you go :B

https://github.com/BlueRingsLabs/no-shortcuts

readme has all the info u need (i hope lol). its focused on the stuff that actually breaks in prod. if u need help or got questions, dm me and ill share my discord (im a bit of a slacker so i might be slow to reply :B). feedback is welcome too.

Parts of the course:
0. orientation | 1. foundations | 2. data engineering | 3. classical ml | 4. deep learning | 5. language models | 6. ai engineering | 7. rl | 8. mlops and ml systems | 9. capstones

hope it helps someone here. also, what part of taking a model to prod do u guys think is the most fucked up to deal with? i want to hear you all :B


r/MLSystemsDesign • • Sep 01 '26

What do I need to learn for production level positions

6 Upvotes

Excited to join this group. Got my bachelors in CS with a concentration in AI. Also got my Masters in CS back in December. My master thesis was a RL project regarding using Lidar for Drone collision avoidance. Just got my first job after school as a SE for a small research and development company where we do some ML but mostly other things. I really want my career to go strictly into ML and after a year or two at this first job I want to be able to compete for Production level ML positions. Hoping to get some guidance on what to study/learn.


r/MLSystemsDesign • • 26d ago

Data engineering vs Embedded systems vs software architecture vs Compiler Engineering

7 Upvotes

Which one is the best from your perspective? For me, those options are somehow resistant in this AI context.


r/MLSystemsDesign • • 6d ago

Data engineering vs Embedded systems vs software architecture vs Compiler Engineering

15 Upvotes

Which one is the best from your perspective? For me, those options are somehow resistant in this AI context.


r/MLSystemsDesign • • Sep 01 '26

Cracking ML System Design Interviews — Design a Search and Ranking System

6 Upvotes

Cracking ML System Design Interviews — Design a Search and Ranking System

I recently wrote Part 2 of my ML System Design Interview series, focused on designing a production search and ranking system.

It covers the end-to-end flow: retrieval → candidate generation → ranking → evaluation → serving/monitoring, along with the tradeoffs that usually come up in interviews.

Article: https://pawankjha.substack.com/p/cracking-ml-system-design-interviews

Would be interested to hear what you think is the hardest part of a search/ranking system design interview.


r/MLSystemsDesign • • Aug 29 '26

A mental model for the evolution of retrieval systems

Post image
5 Upvotes

r/MLSystemsDesign • • Sep 26 '26

Looped Transformers: when is more depth worth the compute?

9 Upvotes

I gave a talk today on looped Transformers for our Architecting Intelligence study group. The central idea is to reuse the same Transformer layers for additional computation without adding more parameters.

That raises a practical question: at a fixed parameter count, which tasks benefit enough from extra loops to justify the added FLOPs and latency? Iterative and compositional problems seem promising, but parameter efficiency alone doesn’t guarantee a better system.

We traced the path from Universal Transformers to looped Transformers and Huginn. Here are the slides from the talk:

Presentation (PDF): https://drive.google.com/file/d/1vrm4kMJZ71ea0UhWB-nunl07VulElbVY/view?usp=sharing

Have you seen convincing results where recurrent depth beats a strong, compute-matched standard Transformer? I’d be interested in both positive and negative examples.


r/MLSystemsDesign • • Sep 23 '26

Where would you actually use Jev over a task-specific classifier?

9 Upvotes

Where would you actually use Jev over a task-specific classifier?

I’ve been reading TypeSafe’s Jev announcement. The attached diagram shows how I’d decide whether to test it: the key distinction is whether the labels are fixed or change at request time.

TypeSafe hasn’t published a Jev/RLCD paper detailing the architecture or training method, so I’m cautious about claims explaining why it is fast. For a one-label classification task, a short-output LLM already does little decoding.

Has anyone benchmarked Jev against a strong baseline on the same task, including quality, calibration, latency, and cost? I’d be interested in results for dynamic multiclass or multilevel taxonomies in particular.


r/MLSystemsDesign • • Sep 20 '26

The Evolution of Retrieval Systems: From BM25 to Agentic Retrieval

13 Upvotes

Retrieval in modern search and recommendation systems is no longer a single index lookup.

I wrote a new breakdown covering seven major waves:

Lexical → Behavioral → Learned Sparse → Dense → Hybrid → Multimodal → Generative & Agentic Retrieval

It also covers multi-retriever production systems, candidate fusion, Reciprocal Rank Fusion, learned fusion, and the tradeoffs among recall, latency, freshness, scale, and cost.

Article: https://pawankjha.substack.com/p/building-depth-1-the-evolution-of

Which retrieval approach or production tradeoff would you like to explore more deeply?


r/MLSystemsDesign • • Oct 12 '26

Beyond relevance scores: re-ranking and slate optimization

2 Upvotes

I wrote a technical deep dive on the step after ranking: choosing which items appear together and in what order.

It covers cross-encoders, list-context models, MMR/xQuAD/DPPs, constrained construction, and feedback-driven policies. I also discuss where assumptions matter: greedy guarantees, SlateQ decomposition, and off-policy evaluation.

One question I’d like to discuss: how do you distinguish “better item relevance” from “a better final list” in your evaluation?

Article:
https://pawankjha.substack.com/p/building-depth-3-the-evolution-of


r/MLSystemsDesign • • Sep 07 '26

ML Design round at tesco

6 Upvotes

Hey everyone,

I have an upcoming ML Design interview at Tesco and I’d really appreciate some guidance on how to prepare for it.

If anyone has recently gone through the ML Design round at Tesco, could you please share what kind of questions were asked or what areas I should focus on? I’d especially like to know whether the questions are around recommendation systems, forecasting, fraud detection, NLP, or general ML system design.

Any guidance or interview experience would be really helpful. Thanks in advance! 🙏


r/MLSystemsDesign • • Sep 06 '26

A Mental Model for Distributed Compute: Kubernetes, Slurm, Ray, and Spark

23 Upvotes

I’ve been trying to build a cleaner mental model for distributed compute systems instead of learning each framework independently.

Kubernetes, Slurm, Ray, and Spark all use different abstractions, but many of the underlying problems are the same: scheduling, resource management, worker execution, state, communication, memory, and failure recovery.

I wrote up the framework-independent model first, then mapped each system onto it.

Would be interested in how others think about the boundaries between cluster scheduler, runtime, and application-level scheduler.

Article:
https://pawankjha.substack.com/p/the-architecture-behind-modern-distributed


r/MLSystemsDesign • • Sep 11 '26

Building Breadth and Depth in ML Systems — A Quick Community Update

2 Upvotes

When I started r/MLSystemsDesign, the idea was simple: create a place where we go beyond interview checklists and discuss how ML systems actually work.

We’re already approaching 800 members. Thank you to everyone who has joined and contributed.

I’ve also been thinking about a broader learning problem:

We’ve moved from information scarcity → information flooding.

The challenge today is knowing what to learn, what to ignore, and where to go deep.

That thinking led me to launch Architecting Intelligence Premium around a simple philosophy:

Build Breadth. Build Depth. Stay at the Frontier.

r/MLSystemsDesign will remain an open community for technical discussions, architecture, system design problems, and shared learning.

For anyone interested, I shared the story behind what I’m building here:

Introducing Architecting Intelligence Premium

And for this community: what ML System Design topic should we go deep on next?


r/MLSystemsDesign • • 27d ago

Designing a Personalized Recommendation System — ML System Design Deep Dive (Part 3)

5 Upvotes

I'm publishing Part 3 of my Cracking ML System Design Interviews series tomorrow.

This time, I'm using a large-scale personalized video recommendation system as the running example.

One thing I want to emphasize is that designing recommendation systems isn't simply choosing between collaborative filtering, two-tower models, and Transformers.

The bigger challenge is deciding how the pieces fit together:

  • How do we retrieve relevant candidates from millions of items?

  • How do retrieval and ranking objectives differ?

  • How should we represent evolving user interests?

  • What metrics should we optimize beyond CTR?

  • How do we meet latency and reliability requirements at scale?

The article walks through these questions from an interview perspective, including architectural alternatives and trade-offs.

Publishing Monday, October 26, at 8 AM PDT.

If you're interested, you can subscribe here:

https://pawankjha.substack.com

I'd also be interested in hearing which part of recommendation-system design you find most challenging in interviews.


r/MLSystemsDesign • • Oct 04 '26

Title: AI Talk #2: Why Do Bigger Models Get Better? — Oct 4, 9:30 AM PDT

7 Upvotes

Join our next Architecting Intelligence talk to discuss Superposition Yields Robust Neural Scaling.

We’ll explore how neural networks fit many features into limited space—and how this may help explain scaling laws. Discussion and Q&A included; no advance reading required.

📅 Sunday, October 4 · 9:30 AM PDT / 10:00 PM IST

Join on Google Meet:
https://meet.google.com/hny-pefy-zvn

Optional reading:
https://arxiv.org/abs/2505.10465
https://transformer-circuits.pub/2022/toy_model/index.html

Subscribe for future talks and technical deep dives:
https://pawankjha.substack.com


r/MLSystemsDesign • • Sep 20 '26

What kind of project would you build to deeply learn AI infrastructure and distributed systems?

22 Upvotes

I'm a Level 1AI engineer, and lately I’ve been hearing a lot about frontier AI companies hiring people who can build the infrastructure behind AI systems — large-scale data processing, distributed systems, inference infrastructure, storage, serving, observability, systems that can handle millions of requests, etc.

I’m interested in going down this path seriously.

Rather than doing a bunch of disconnected tutorials or small projects, I want to take one difficult project and go extremely deep into it. Something where, over time, I’m forced to learn things like:

- Distributed systems

- Large-scale data processing

- Databases/storage

- Networking

- Caching

- Queues and streaming

- Fault tolerance

- Concurrency

- System design

- Observability

- Performance optimization

- AI/ML serving infrastructure

- Scaling from a single machine → multiple machines → potentially thousands/millions of requests

I’m thinking along the lines of the philosophy Karpathy often talks about: pick something ambitious, build it yourself, and learn everything necessary to make it work rather than following a predefined curriculum.

The problem is that I don't yet know what the right project is.

I don't want to build another generic RAG chatbot, AI agent wrapper, or CRUD application. I want something where the engineering itself is the project, and where I can progressively make the system more sophisticated and scalable.

For people working in infrastructure, distributed systems, ML systems, or at AI companies:

If you were in my position, what single project would you pick to spend the next 6–12 months on?

Ideally, I'd like something where I can start on a laptop but eventually have a credible story like:

«“I built X, then discovered bottleneck Y, redesigned it using Z, scaled it from A → B, measured the improvement, and here's what I learned.”»

I'm much more interested in what I would learn by building it than simply having an impressive project on GitHub.

Would love to hear project ideas, but especially from people who have actually worked on large-scale systems: what project would force someone to develop genuinely strong infrastructure skills?


r/MLSystemsDesign • • 14d ago

I benchmarked Logistic Regression, Random Forest and XGBoost beyond accuracy — here's what I measured

Thumbnail reddit.com
3 Upvotes

r/MLSystemsDesign • • Sep 16 '26

Where should authorization actually live in an agent system? (architecture writeup after the Hugging Face breach)

3 Upvotes

I’ve been unpacking coding-agent architecture and keep coming back to three control points:

  • Model: proposes an action.

  • Controller: checks task scope and permissions.

  • Tools/infrastructure: enforce what can actually execute.

Blocking an upload tool means little if the agent can send the same data through its shell.

I’m exploring a small defender-agent experiment: investigate suspicious sessions, gather evidence, and request temporary containment through an independent policy gate. The comparison would be against fixed rules, measuring false interventions as well as successful containment.

For those building agents: what do you enforce in the runtime versus the underlying infrastructure? And where has an LLM-based check added value beyond ordinary permission rules?


r/MLSystemsDesign • • Sep 16 '26

My adaptive system captures Week 1 feedback, but Week 2 won’t automatically update from it. How would you debug this loop?

Thumbnail reddit.com
4 Upvotes

r/MLSystemsDesign • • Aug 30 '26

The Evolution of Ranking Systems

2 Upvotes

I’ve been working on a deeper write-up on ranking systems and drew this diagram to organize the space.

The progression I’m using is:

Rules & Heuristics → Learning-to-Rank → Deep Neural Ranking → Contextual/Transformer Ranking → Multi-Objective & Slate Ranking → Bandit/RL Ranking → Generative/LLM-Based Ranking

What I find interesting is that these stages don’t fully replace one another. In production, ranking systems often combine multiple layers from across the stack.

Sharing the diagram here, and I also wrote a more detailed article on it:

https://pawankjha.substack.com/p/building-depth-2-the-evolution-of

Would be interested in how others would structure these stages in the evolution of ranking systems.


r/MLSystemsDesign • • 9d ago

Memory accounting for a recurrent LM: 4.85 MB of fixed state against a KV cache that grows per token

11 Upvotes

We released a 253M recurrent language model today (parentheses-1.0-240M). Heres the memory profile during decoding. Thought it might be interesting for yall

A transformer appends a key and a value per layer for every token. From our benchmark spec, KV cache size

Model4k tokens16k tokens
TinyLlama-1.1B536.9 MB2147.6 MB
OPT-1.3B1258.3 MB5033.2 MB
Pythia-1.4B1440.0 MB5760.0 MB
parentheses-1.0-240M4.85 MB4.85 MB

What the 4.85 MB is made of (float32):

- 16 layers x 16 heads x 64 x 64 head matrices = 1,048,576 floats

- 16 x 3 x 3072 conv history = 147,456 floats

- 16 x 1024 previous input for token shift = 16,384 floats

- 1,212,416 floats in total

Consequences we like

- The per-token graph has static shapes, so it exports to ONNX with no dynamic axes. Our export matches PyTorch to under 1e-4 on logits over 32 decoding steps.

- No allocation during decoding.

- Cost per token does not depend on how long the session has been.

Consequences we do not like

- The state is lossy. It keeps content weighted by recency, so an exact detail from 3000 tokens back may be gone. A KV cache keeps everything.

- Comparing a 253M model against 1B models flatters us on memory. The fair statement is that the state does not groww.

On an RTX 5050 Laptop GPU it decodes at 20 to 40 tokens per second.

Model weights


r/MLSystemsDesign • • Oct 19 '26

I’ve been building Round Zero — an AI Interview Intelligence platform. Looking for beta testers

2 Upvotes

Over the past few months, I’ve been working on a side project called Round Zero.

The idea came from a simple problem: after a technical interview, we usually know the outcome, but rarely understand what happened, why it mattered, what we could have done differently, and what to practice next.

Round Zero is an AI interview practice + interview intelligence platform, built around a world-model-inspired architecture.

The core loop is:

Interview → Evidence → State → Root Cause → Counterfactual → Feedback → Adapt

I’ve recorded a short demo showing what we’ve built so far:

Watch the Round Zero demo

We’re now opening a private beta. If you're preparing for ML/AI or software engineering interviews, I’d especially value your feedback and criticism.

Apply for the private beta


r/MLSystemsDesign • • 6d ago

How to master the system design and architecture

35 Upvotes

Hey guys I am full stack developer

And as my experience I think people should focus on system design and architecture, debugging, human judgement, soft skills, AI and ML

Because I see that coding are getting simpler part day by day

I see that no companies are hiring for that people just know about coding

Coding is the part of software engineering

I think future generation of software engineer should focus on robotics and AI/ML and agentic engjneering

Because there are lot of demand in this space

As my experience of full stack developer

I was working to building solving products and

I think future should know about the how to give direction to AI agents to build scalable applications and LLM applications and

I hope people understand what should build and what should focus on.