Skip to content
TheChatArchiveThe Chat Archive
o3-2025-04-16· OpenAIHugging Face LMArena Human Preference 140K

Describe a scenario where pipeline forwarding eliminates a data hazard.

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Geminigemini-2.5-pro’s answer.
  1. User

    Describe a scenario where pipeline forwarding eliminates a data hazard.

  2. Assistant

    Below is a concrete, textbook-style example that shows

    • the hazard,
    • how many cycles it would normally cost, and
    • how a single forwarding path lets the CPU run with zero stalls.


    Assumptions

    Pipeline: 5 stages (IF – ID – EX – MEM – WB)
    Forwarding paths: ALU-result can be sent from the EX/MEM pipeline register or MEM/WB pipeline register directly back to an ALU input of the very next instruction.


    Instruction sequence that triggers a RAW (read-after-write) hazard

    1. ADD R1, R2, R3 ; R1 ← R2 + R3
    2. SUB R4, R1, R5 ; R4 ← R1 – R5 ←––– needs the value just produced

    Timeline WITHOUT forwarding (one bubble inserted)

    Cycle →123456
    ADDIFIDEXMEMWB
    SUBIFSTALLIDEXMEM

    Explanation:
    • During cycle 3, SUB is in ID and needs R1, but ADD hasn’t written it back (will happen in cycle 5).
    • The control logic inserts a bubble, pushing SUB one cycle later, costing 1 extra cycle.


    Timeline WITH forwarding (no bubble)

    Cycle →12345
    ADDIFIDEXMEMWB
    SUBIFIDEXMEM

    What changed?
    • At the end of cycle 3, ADD’s ALU produces the result (R1) and stores it in the EX/MEM register.
    • At the very start of cycle 4, the forwarding unit detects that SUB needs R1, grabs the value from that EX/MEM register, and routes it straight to one of the ALU inputs.
    • SUB can therefore execute in cycle 4 without waiting for the normal WB stage.


    Key Take-away

    Pipeline forwarding converts what would have been a 2-cycle producer/consumer distance (EX→WB then read) into an effective 0-cycle distance (EX→EX), eliminating the stall and saving a full pipeline cycle.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.