SuperAPI AI Directory

ai-pipeline

Design & creation

View repository

Updated 10-15 23:44

About this skill

Source Metadata

Original cangjie-skill frontmatter from the distillation run:

id: f19
title: "AI流水线 — 多组件串联的系统设计模式"
book: "AI for Everyone"
author: "Andrew Ng(吴恩达)"
source: p19, p20
tags: [system-design, pipeline, architecture, multi-module, error-propagation]
related_skills:
  - slug: ml-workflow, relation: composes-with
  - slug: ab-mapping, relation: depends-on

R — Reading (original quote)

"A four-step or multi-step process of an AI system like this is sometimes called a pipeline — multiple AI components collaborating to process data in sequence... A complex AI product like autonomous driving requires multiple AI components to work together." — p19, p20

I — Interpretation (restate in your own words)

Many complex AI products cannot be solved with a single A→B mapping; the problem needs to be decomposed into multiple steps, each step being an independent A→B module, and these modulesin seriesform a pipeline:

Classic case 1: Smart speaker

  1. Wake detection (audio→whether it is the wake word)
  2. Speech recognition (audio→text)
  3. Intent recognition (text→user intent)
  4. Command execution (intent→execute action)

Classic case 2: Autonomous driving

  1. Object detection (sensor data→object positions)
  2. Motion prediction (object positions→future trajectories)
  3. Path planning (trajectory prediction→driving path)
  4. Control execution (path→steering wheel/throttle/brake)

Key insight: error accumulation

  • If each module has 95% accuracy, after 4 modules are connected in series the overall accuracy is only 0.95^4 ≈ 81%
  • This meanshigh single-module metrics ≠ a good overall system
  • Optimization must be done from an end-to-end system perspective, not by looking only at single-module metrics

A1 — Past Application (past application cases)

  • Smart speaker: Early smart speakers often made errors recognizing simple commands like "set a timer." Analysis found: wake success rate 98%, speech recognition 96%, intent recognition 97%, execution 99%, but end-to-end was only 0.98×0.96×0.97×0.99≈90%. The 10% error rate made the user experience very poor. The team later optimized the weakest link (speech recognition), and the overall experience improved greatly.

A2 — Future Trigger (future trigger conditions)

Trigger scenarios:

  • Designing a complex AI product that requires multiple steps/modules
  • Single-module metrics are all high, but the user experience is poor (possibly due to error accumulation)
  • Need to decompose a complex AI problem into multiple sub-problems
  • Multiple teams collaborating to develop one AI system

Language signals:

  • "multiple AI modules"
  • "pipeline"
  • "AI system architecture"
  • "modules in series"
  • "end-to-end"
  • "error accumulation"
  • "complex AI product"

Distinguishing points:

  • Is ita single A→B problemora multi-step problem? For a single one use ml-workflow; for multiple use this skill.
  • Focus onsystem designorprocess management? This skill is oriented toward system design.

E — Execution (execution steps)

  1. Decompose the problem: Decompose the complex AI problem into multiple consecutive A→B steps.

  2. Draw the pipeline: Clarify the input (A) and output (B) of each step, as well as the data flow between steps.

  3. Evaluate single-module performance: Set independent accuracy/performance metrics for each module.

  4. Calculate end-to-end performance: Estimate overall performance by multiplication (the product of each module's accuracy).

  5. Identify bottlenecks: Find the module with the greatest impact on overall performance (usually the stage with the lowest accuracy).

  6. Optimization strategy:

    • Prioritize optimizing the weakest module
    • Consider adding redundancy or human fallback at critical steps
    • Design end-to-end evaluation metrics (rather than looking only at single modules)
  7. Organizational design: Each module can be owned by a different team, but unified interface specifications and end-to-end testing are required.

Completion criteria: Complete the pipeline architecture diagram, clarifying each module's A→B mapping, interface specifications, and end-to-end performance metrics.

B — Boundary (usage boundaries)

Not applicable scenarios:

  • Problems that a single A→B mapping can solve (no pipeline needed)
  • No sequential dependency between modules (can be processed in parallel)
  • Low system complexity (fewer than 2 modules)

Failure modes:

  • Looking only at single-module metrics, ignoring end-to-end performance
  • Non-standard interfaces between modules, leading to data transfer errors
  • Each module is optimized by a different team, but no one is responsible for the end-to-end result
  • Over-engineering the pipeline—splitting into three modules something that could be solved with one model

Author's blind spots:

  • Andrew Ng did not discuss in depthfeedback loops between modules—In real systems, the result of a later step may need to be fed back to an earlier step (such as re-waking when speech recognition makes an error).
  • The error accumulation model assumes modules are independent, but in reality modules may becorrelated—an error in one module affects the input distribution of the next module.

Related skills

  • ml-workflow — composes-with: An AI pipeline is an extension of the ML workflow—each module internally follows the ML workflow (collect→train→deploy), and multiple modules connected in series form a pipeline. The combination of the two covers the complete execution flow from a single model to a multi-module system.
  • ab-mapping — depends-on: Each module in a pipeline is essentially an A→B mapping; understanding ab-mapping is a prerequisite for designing a pipeline.