{
  "id": "bbg-p0130-search-retrieval-and-rag-search",
  "title": "Transformer Encoder Decoder Flow",
  "chapter": "ai-models-and-llm-systems",
  "batch": "08",
  "rank": 71,
  "sourcePage": 130,
  "sourcePointer": "p. 130",
  "status": "accepted",
  "reviewerStatus": "reviewed",
  "fidelityScore": 0.9,
  "canvas": {
    "width": 960,
    "height": 640
  },
  "fireworksTechGraph": {
    "style": "style-1-flat-icon",
    "diagramType": "data-flow",
    "topologyNotes": [
      "source page render inspected",
      "extracted page text inspected",
      "source page render inspected",
      "preserve Transformer architecture: token embedding, positional encoding, encoder attention/feed-forward blocks, decoder masked attention, cross attention, and output projection",
      "retargeted from RAG chapter to ai-models-and-llm-systems"
    ],
    "publicBoundary": [
      "original vector output",
      "no source pixels",
      "no source mark or long wording"
    ]
  },
  "callouts": [],
  "sourceReview": {
    "conceptAnchors": [
      "concept: input embedding",
      "concept: positional encoding",
      "concept: multi-head attention",
      "concept: encoder decoder",
      "concept: linear softmax output"
    ],
    "labelSource": "curated",
    "semanticStatus": "reviewed"
  },
  "groups": [
    {
      "id": "encoder",
      "label": "Encoder",
      "x": 70,
      "y": 132,
      "w": 360,
      "h": 310
    },
    {
      "id": "decoder",
      "label": "Decoder",
      "x": 530,
      "y": 132,
      "w": 360,
      "h": 310
    }
  ],
  "shapes": [
    {
      "id": "input",
      "kind": "rect",
      "label": "Input tokens",
      "detail": "embedding",
      "x": 118,
      "y": 176,
      "w": 126,
      "h": 58,
      "tone": "blue"
    },
    {
      "id": "pos",
      "kind": "rect",
      "label": "Position",
      "detail": "word order",
      "x": 272,
      "y": 176,
      "w": 126,
      "h": 58,
      "tone": "teal"
    },
    {
      "id": "attn",
      "kind": "hex",
      "label": "Self attention",
      "detail": "relations",
      "x": 194,
      "y": 286,
      "w": 126,
      "h": 78,
      "tone": "purple"
    },
    {
      "id": "ff",
      "kind": "rect",
      "label": "Feed forward",
      "detail": "transform",
      "x": 194,
      "y": 392,
      "w": 126,
      "h": 58,
      "tone": "green"
    },
    {
      "id": "masked",
      "kind": "hex",
      "label": "Masked attention",
      "detail": "predict next",
      "x": 578,
      "y": 176,
      "w": 138,
      "h": 78,
      "tone": "orange"
    },
    {
      "id": "cross",
      "kind": "hex",
      "label": "Cross attention",
      "detail": "read encoder",
      "x": 728,
      "y": 286,
      "w": 138,
      "h": 78,
      "tone": "purple"
    },
    {
      "id": "output",
      "kind": "rect",
      "label": "Linear softmax",
      "detail": "next token",
      "x": 642,
      "y": 392,
      "w": 138,
      "h": 58,
      "tone": "red"
    }
  ],
  "connectors": [
    {
      "from": "input",
      "to": "pos",
      "label": "add",
      "flow": "main"
    },
    {
      "from": "pos",
      "to": "attn",
      "label": "encode",
      "flow": "main"
    },
    {
      "from": "attn",
      "to": "ff",
      "label": "normalize",
      "flow": "data"
    },
    {
      "from": "ff",
      "to": "cross",
      "label": "context",
      "flow": "data"
    },
    {
      "from": "masked",
      "to": "cross",
      "label": "target",
      "flow": "main"
    },
    {
      "from": "cross",
      "to": "output",
      "label": "project",
      "flow": "data"
    }
  ]
}
