How I AI: Mental Models, Failure Modes, Long Horizon Workflows

Get a man-year's amount of work done overnight.

Mark Ruvald Pedersen

2026-03-23

Mark Ruvald Pedersen

❯ whoami

mpedersen

Senior Firmware Engineer at NVIDIA · Copenhagen

  • Span electronics to compilers: embedded firmware, real-time, audio, Bluetooth, algorithms, and developer tooling.
  • Previously: firmware and DevEx architecture at Oticon; biometric algorithms at Fingerprint Cards; compiler thesis at Intel.
  • DTU: M.Sc. in Computer Science and Engineering, Honours programme.
  • Concepts first: decomposition, architecture, and theory. I build tools that make hard problems easier to understand and solve.
  • Outside work: husband, father, and evening hacker, often with AI.

Blog · radix63 · GitHub · eisbaw · LinkedIn · ruvald

Mark Ruvald Pedersen
→ Showcase

Showcase

Mark Ruvald Pedersen
→ Showcase

Greenfield Projects

Mark Ruvald Pedersen
→ Showcase

Brownfield: Fixes and Improvements

Mark Ruvald Pedersen
→ What AI Actually Is

What AI Actually Is

Mark Ruvald Pedersen
→ What AI Actually Is

Neural Networks as Universal Function Approximators

  • Universal function approximators: with enough capacity and suitable nonlinear activations.
  • Latent space (“J-space”): learned internal representations can support emergent language translation.
  • Composition at massive scale: breadth of features, depth of layers.

“Composition over Inheritance”
Proven once again.

Function composition: apply g from X to Z first, then f from Z to Y; (f ∘ g)(x) = f(g(x))

Mark Ruvald Pedersen
→ What AI Actually Is

Training as Compression

  • Training LLMs on internet-scale data is all about the discovery of patterns.
  • These patterns become weights, the lowest level of the hierarchy; internally, they form islands of latent space that compose together.
  • Compression is pattern discovery

Training data compressed into weights, with a brace zooming into a pattern pyramid from syntax through semantics and intent to domain

You’re talking with “All Of Humanity.”

LLMs distill humanity’s patterns and personas, the ultimate “schizophrenic.” Their extreme versatility means we must be specific about role, context, and intent.

Mark Ruvald Pedersen
→ What AI Actually Is

Layers from Pressure

  • Abstraction and separation of concerns emerge naturally from pressure.
  • Earth crust analogy: gravity shapes geological layers; training loss shapes learned representations.

Latent space visualized using t-SNE

Click to enlarge · Source: GeeksforGeeks

Earth crust layers compared with neural network abstractions

Mark Ruvald Pedersen
→ What AI Actually Is

The Stochastic Nature

  • Next-token prediction produces a probability distribution.
  • Sampling introduces variation: the same prompt can yield different answers.
  • Context steers the distribution: wording, instructions, and examples change what becomes likely.
  • Emitted tokens stay: ordinary autoregressive generation appends. It can correct later, but cannot erase earlier tokens.
  • CoT is a draft scratchpad: reconsider intermediate steps before presenting the final answer.
  • Fusion still helps: independent attempts plus synthesis improved OpenRouter’s DRACO evaluation scores.

Many-worlds-style branching as a metaphor for possible token continuations, with one emitted path highlighted and a Fusion comparison below

“I speak one word at a time, but I’m drawing on a larger context I want to convey. The message is richer than its serial delivery.”

Plausible ≠ correct. Without feedback, errors can compound unchecked.

Mark Ruvald Pedersen
→ How It Fails and Why

How It Fails and Why

Mark Ruvald Pedersen
→ How It Fails and Why

Failure Modes

  • Hallucinations: plausible-sounding nonsense
    • Discoverable by fact-checking or running tests
  • Overconfidence: fluent ≠ correct
  • Context poisoning: early wrong info propagates
  • Context distraction: irrelevant bulk degrades everything

When NOT to Use AI

  • Need deterministic guarantees? Use a calculator or tested algorithm.
  • Let AI write and call tools you can inspect, test, and re-run.

An early incorrect fact poisons downstream context like falling dominoes

Open-loop responses to prompts cannot be trusted. Failure rate drops dramatically with lower prompt ambiguity.

Mark Ruvald Pedersen
→ How It Fails and Why

Open-Loop vs Closed-Loop

Free climbing versus climbing with a belayer and feedback

Mark Ruvald Pedersen
→ How It Fails and Why

Fundamental Constraints

  • Don't blindly trust AI.
  • No persistence beyond session context
    • Volatile RAM, no flash; power-cycles between tasks
  • No self-understanding or metacognition
  • Stochastic: cannot expect 100%
  • Chain-of-Thought is a scratchpad, not actual reasoning
    • A workspace for the model, not a window into its thinking

Recall degrades as the context window fills

Mark Ruvald Pedersen
→ How It Fails and Why

Demo: The Carwash Example

Open-loop / ambiguous

“The carwash is 50 meters away”

Spec failure. What does the model do with this?

Strawberry problem

“How many r's in strawberry?”

Tokenization limitation, addressable with tool use.

Key insight: Same task, different context → dramatically different quality.

The bottleneck is the human, not the model.

Mark Ruvald Pedersen
→ Context Engineering

Context Engineering

Mark Ruvald Pedersen
→ Context Engineering

The Context Window Is a Soup

Exploration is expensive.
Distillation is cheap.
Keep context clean.

  • At prompt zero: no context, only weight biases
  • Context window is limited and recall degrades

Context as a soup of instructions, tools, history, and task information

Mark Ruvald Pedersen
→ Context Engineering

The Fresh Onboarding Problem

  • AI onboards fresh every session
    • No flash; power-cycle between tasks
    • Newly hired Professor
  • Ramp-up must be smooth: codify conventions
  • Best practice for humans = good for AI
  • Two levels of context:
    • Long-term: PRD, CLAUDE.md, arch docs
    • Short-term: task with motivation, verification

A context window behaves like volatile RAM between sessions

Mark Ruvald Pedersen
→ Context Engineering

Conventions, Not Just Instructions

  • Not syntax politics: “use snake_case” is a DontCare
  • Provide semantic and intent guidelines
    • “we do not block on the main loop thread”
  • Each added instruction reduces reliability
  • Too many concerns = cognitive overload
    • Wear different hats; refine iteratively

One overloaded agent compared with focused agents wearing different hats

Mark Ruvald Pedersen
→ The Workflow

The Workflow

Mark Ruvald Pedersen
→ The Workflow

Strategic Documents Hierarchy

  • AI can't do what it does not know; fix your docs first.
  • PRD: What and why (vision, goals)
  • Design: Specs (architecture, philosophy)
  • Plan: When (sequential task breakdown)
  • Behavior: Conventions, tool usage, testing

PRD = destination
Design = vehicle
Plan = route map

A pyramid of strategic documents from long-lived intent to short-lived tasks

Mark Ruvald Pedersen
→ The Workflow

Sub-Agent Telescoping and Distillation

  • Divide concerns, not just work
  • Context pollution degrades all concerns
  • Each added instruction reduces reliability

Explorer, implementer, and reviewer pass distilled findings into fresh contexts

Mark Ruvald Pedersen
→ The Workflow

Fork-Join in Detail

A parent agent forks focused sub-agents and joins their distilled conclusions

Parent prompts sub-agent with focused task. Sub-agent explores (~50k tokens), returns distilled conclusion (~100 tokens).

Mark Ruvald Pedersen
→ The Workflow

The Feedback Loop

Explore, distill, design, implement, test, review, then refine and repeat

  • Let AI make something that works, then refine
  • Grounding through testing and review = the last 80% of quality
  • Don't declare failure on the first mistake. Use negative feedback loops grounded in reality
Mark Ruvald Pedersen
→ The Workflow

Inner and Outer Loops: The Art Is in the Inner Testing

A dashed orchestrator context spawns implementation and review/test/fix subagents below it, then receives their conclusions; human and CI feedback forms the outer loop

Mark Ruvald Pedersen
→ The Workflow

Context Engineering: Before vs After

Vague prompts become grounded results through feedback; illustrative success rates rise from to

Mark Ruvald Pedersen
→ The Workflow

The Art of Grounding

Convert open-loop AI work into closed-loop work with deterministic validation

Mark Ruvald Pedersen
→ The Workflow

Continuous Improvement

  • Every time you repeat yourself → make it a command or skill going forward
  • Every time something went wrong → consider permanent correction
  • Fix papercuts immediately once and for all.
  • Sub-agent personas for recurring concerns
    • Architect, Gardener, Tester, …
  • Do not overload one agent. Divide and conquer.

AI may not know the architecture and add solutions that incur technical debt.
Separate explore from refine: different hats.

Mark Ruvald Pedersen
→ The Workflow

Greenfield vs Brownfield

Greenfield and brownfield workflows converge on an executable backlog

Mark Ruvald Pedersen
→ The Workflow

Greenfield: From Prompt to Execution

From an initial prompt through interviews and planning to a grounded execution loop

Mark Ruvald Pedersen
→ The Workflow

The Ralph Loop

  • Embrace the Shakespearean monkey typewriter
    • Let it work, but provide guardrails
    • Design your guardrails; you get what you measure. Think very hard about this. You can afford to be unreasonably strict, even to the point of formal verification or building simulation models for fuzzing.
    • Engineer harness to provide negative feedback loop; ground in reality
  • Ralph loop only works when:
    • Grounded in reality: tests, linters, review
    • Fresh context windows: no stale state
    • Onboarding setup: PRD, conventions

Repeated fresh agent sessions use a persistent workspace and backlog

Mark Ruvald Pedersen
→ Concrete Tools and Next Steps

Concrete Tools and Next Steps

Mark Ruvald Pedersen
→ Concrete Tools and Next Steps

Tips: Make Errors Unlikely and Recoverable

Make errors unlikely

  • Ask for the desired action. Broad “remove” or “clean up” instructions can linger in context and bias later work toward deletion.
  • “Don't think of the pink elephant.” Negation still names the idea. Say: “Move stale files to cruft/.” instead of “Delete stale files.”

Make errors recoverable

  • Commit and push to Git. Use Docker or VMs to limit the blast radius; restrict mounts, credentials, and network access.

Guard the software supply chain

  • Malicious packages can steal IP and compromise the enterprise. Hallucination squatting registers package names invented by AI.
  • IT-managed package gateway: registry configuration + DNS/egress controls → NGINX + a controlled package repository.
  • Log, scan, delay/quarantine, and alert. HTTPS inspection needs managed certificate trust; detection and quarantine need security tooling behind the proxy.

Sources: Package hallucinations · USENIX · Repository quarantine · NGINX TLS

Mark Ruvald Pedersen
→ Concrete Tools and Next Steps

Tips: Batch Work and Tighten Feedback

  • Think in batched arrays. Work in categories; give the agent a set of related changes together.
  • My presentation workflow: collect review comments in an editor, group them, then send the harness one batch.
  • Use voice input. Capture more detail, faster. Say important ideas in two different ways to reduce misinterpretation.
  • Let AI write a strict language such as Rust. Types, ownership checks, compiler errors, lint, and tests provide strong negative feedback loops.
  • Use mutation testing. Let AI deliberately introduce bugs, then run your unit tests. They should fail. If they still pass, strengthen the tests.
  • Mine your own prior sessions. Let AI analyze them for recurring patterns and pitfalls, then fix those problems in your workflow. Rinse and repeat.
Mark Ruvald Pedersen
→ Concrete Tools and Next Steps

Tooling and Tool Friction

  • Know which tools help and which obstruct. Favor inspectable inputs, clear errors, automation, and fast feedback.
  • Marp → HTML + Git: my choice over PowerPoint. Open source, fast, easy to diff, and friendly to AI.
  • Nix + just: use Nix for all software; pin environments and give build/check steps one command, locally and in CI.
  • Task management: prefer an in-repo backlog for daily tasks; use Jira for epics.
  • mosh + Zellij: resilient remote terminals and persistent workspaces.
  • Rust: a strict language with compiler feedback, lint, and tests to drive correction.

Tool friction consumes attention and context. Good tooling shortens the path from an idea to a result you can check.

Mark Ruvald Pedersen
→ Concrete Tools and Next Steps

My Agents and Skills

Three skills take intent through PRD, reviewed backlog, and tested execution; MPED provides architecture, QA verifies, and Compass advises direction

github.com/eisbaw/mped-skills

Mark Ruvald Pedersen
→ Concrete Tools and Next Steps

AI usage levels

Five ways to use AI: conversation, editor assistance, delegated engineering, backlog-driven execution, and perpetual improvement

Mark Ruvald Pedersen
→ Concrete Tools and Next Steps

GACIA: Autonomous Perpetual Improvement

  • Waiting for humans to prompt AI is the bottleneck
  • Define perpetual tasks once; AI runs them on a schedule
  • AI pushes branch, CI validates, auto-creates MR
  • Humans review when ready, without blocking
  • Codebase improves continuously:
    • Clean up technical debt, add features, refactor, simplify, optimize, fix latent bugs, implement next backlog task

Human-prompted work compared with scheduled autonomous improvement

Mark Ruvald Pedersen
→ Concrete Tools and Next Steps

The Backlog Workflow

github.com/MrLesk/Backlog.md

  • Keep small tasks in-repo. External trackers add latency and races between task state and code.
  • Jira can still serve epics. At 30+ tasks a day, individual tasks need a faster loop.
  • Let AI create, comment on, and execute tasks with minimal friction. Humans and AI share the same backlog.
  • Put all context in the task: motivation, consequences, fix approach, and verification.
  • Ground execution: fresh contexts, distilled findings, tests, and review make work resumable.
  • Commit task state with code. Motivation, decisions, and results remain discoverable through git blame and ripgrep.
Mark Ruvald Pedersen
→ Concrete Tools and Next Steps

Thinking Hacks and Crutches

  • Chain of Thought: a scratchpad, not the model's actual thoughts
  • RAG: grounding with external knowledge
  • Tool use: let deterministic tools do deterministic work
    • The calculator principle: don't let LLMs do math
  • Stage-based splitting: manage complexity through decomposition
  • Parallel sub-agents: reduce pressure on single context window

These are crutches, but essential ones. Some will fold back into future models.

Mark Ruvald Pedersen
→ Takeaways

Takeaways

Mark Ruvald Pedersen
→ Takeaways

AI is an Amplifier

  • We are shepherds of fast, fallible AIs
  • AI won't replace humans until it can telepathically know what you or your users want. Until then, it still needs to be prompted.
  • AI is work: investment in context, structure, and review
  • The ROI is massive, but it is not free

An engineer shepherds a team of fast but fallible AI sled dogs

Mark Ruvald Pedersen
→ Takeaways

Skills of the Future

  • Imagination: envision what is worth creating.
  • Expertise: know what is technically possible and how to make it robust.
  • Deep conceptual understanding: learn ideas and relationships; look up details instead of relying on rote memorization.
  • Philosophy and taste: define what is Good and Bad. Even autonomous AI needs goals, direction, and criteria.
  • Marketing: understand an audience, communicate value, and earn adoption.
Mark Ruvald Pedersen
→ Takeaways

Monday Morning: What to Do Differently

  1. Self-reflect on ambiguity before blaming the tool
  2. Start codifying conventions
    • Your coding standards doc = system prompt for AI
  3. Try the backlog workflow: full context per task, let AI execute
  4. Wear one hat at a time, for yourself and for the AI
Mark Ruvald Pedersen
→ Meta

Meta

Mark Ruvald Pedersen
→ Meta

How This Presentation Was Made

The prompt that triggered this slide deck

“Make a beamer presentation. Add justfile to build to PDF, and another recipe to extract each PDF page to JPG at 150 dpi 80% quality under a pages.tmp/ folder. This allows Claude to read in the beamer pages to visually review and audit. As a last slide, summarize this session's flow: digest a soup of context, ask me questions, organize the soup, concretize, plan break down and ground. Include this very prompt on the slide.”

Session flow:

  1. Digest a soup of unstructured notes and context
  2. Interview: ask targeted questions to extract intent and constraints
  3. Organize the soup into coherent structure
  4. Concretize: turn ideas into actionable outline
  5. Plan, break down, and ground: tasks, tooling, deliverables
Mark Ruvald Pedersen
→ Meta

References

Mark Ruvald Pedersen

Q&A

Mark Ruvald Pedersen

Universal approximation means approximation of continuous functions on compact domains to arbitrary accuracy, given sufficient capacity and suitable activations; it does not guarantee that training finds those weights. https://arxiv.org/abs/1905.08539 Shared multilingual representations can support zero-shot translation; “J-space” is informal terminology here, not the name of a universal canonical space. https://research.google/pubs/googles-multilingual-neural-machine-translation-system-enabling-zero-shot-translation/ “Composition over Inheritance” is a software-design analogy, not a theorem about OOP.

The branching drawing is a many-worlds metaphor, not a claim that LLM sampling is quantum. The commitment point refers to emitted tokens in ordinary autoregressive generation: later text can correct an earlier statement, while editing tools or an outer system can rewrite an artifact. Scratchpad tokens are also generated sequentially; they provide room to reconsider before emitting the final answer, rather than erasing past tokens. CoT and scratchpad research: https://arxiv.org/abs/2201.11903 and https://arxiv.org/abs/2112.00114 Fusion figures are OpenRouter's reported DRACO evaluation: Opus 4.8 alone scored 58.8%, versus 65.5% for two Opus 4.8 participants with Opus 4.8 synthesizing. This involves additional inference and is not a claim of universal gains across tasks. https://openrouter.ai/blog/announcements/fusion-beats-frontier/

Conceptual model, not a calibrated equation.

Prefer a concrete positive action over a broad cleanup instruction; this is a prompting heuristic, not a claim that models cannot understand negation. Git recovery covers tracked, committed files. Containers and VMs reduce impact only within their configured boundaries. Package hallucination attacks are also called slopsquatting. The cited study establishes the risk, not a current incident-growth rate. Package clients should use an approved registry; egress policy prevents bypass. DNS redirection alone cannot inspect HTTPS. Managed TLS inspection requires client trust in the enterprise CA and verified upstream TLS. NGINX provides proxying/logging; scanning, quarantine, and breach detection require additional policy/security services. A delay creates a detection window, not a guarantee.