## Diagram: ZS-FinDSL Prompt for FinQA
### Overview
The diagram illustrates a structured workflow for a Language Learning Model (LLM) to process financial question-answering (FinQA) tasks. It breaks the process into four stages: **Reasoning extraction**, **Program extraction**, **LLM answering**, and **Answer extraction**. Color-coded elements (Signifier, Meme, Constraining behavior, Meta prompt, Input) define the components and their relationships.
---
### Components/Axes
- **Legend**:
- Black: Signifier (labels for components)
- Orange: Meme (proxy for specific elements)
- Pink: Constraining behavior (rules for operations)
- Green: Meta prompt (instructions for the LLM)
- Blue: Input (data or questions)
- **Key Elements**:
- **Reasoning extraction**:
- Input: "Read the following passage and then answer the question."
- Output: "Answer with reasoning from LLM."
- **Program extraction**:
- Input: Question-answer pair.
- Output: Program generated by the LLM (e.g., arithmetic/logic operations).
- **LLM answering**:
- Input: Passage + question.
- Output: Answer from LLM.
- **Answer extraction**:
- Input: Question + LLM answer.
- Output: Final answer (e.g., numerical/boolean value).
---
### Detailed Analysis
1. **Reasoning extraction**:
- The LLM reads a passage (text + table) and answers a question by identifying relevant values and performing step-by-step calculations.
- Example: "Answer this question by finding the relevant values and performing step by step calculations."
2. **Program extraction**:
- The LLM generates a program based on the question-answer pair. The program must:
- Use operations restricted to: `arithmetic` (add, subtract, multiply, divide, exponent) and `logic` (greater-than, max, min).
- Follow a strict format: `{"PROGRAM": [{"OPERATION": "arithmetic/logic", "ARG1": "float/int", ...}, ...], "ANSWER": "numerical/boolean"}`.
- Example program: