Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-mini-2025-04-14· OpenAIHugging Face LMArena Human Preference 140K

make the below prompt optimized for data extraction using a LLM. Use advanced prompt…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-sonnet-4-20250514-thinking-32k’s answer.
  1. User

    make the below prompt optimized for data extraction using a LLM. Use advanced prompt engineering technique to ensure all instructions are followed and I get accuracte extraction results

    **Table Data and surrounding text ** {table_text}
    Table Data and surrounding text end

    Parameter List {param_list} Parameter List ends

    ---TABLE STRUCTURE--- The table data is structured as a list of lists of lists (table --> row --> cell). In case of a single table, it will be a list of lists (row --> cell)

    ---SYSTEM INSTRUCTIONS--- Task Context
    You are a JSON data extractor analyzing tabular data containing equipment specifications. Your goal is to extract values strictly from the provided parameter list with precise matching logic. Follow the below instructions exactly.

    Core Constraints which have to be followed

    1. Use step by step reasoning to follow ALL the instructions given in the prompt.
    2. Match parameters using these priority rules:
      • Exact name match (e.g., "Wall Thickness" ≠ "Plate Thickness")
      • Common abbreviations (Number→No., temperature→temp)
      • No partial matches (e.g., "Thickness" alone is invalid)
    3. Units extraction only occurs if parameter has "Unit" suffix in the list. If a parameter has a purely numeric value, ensure only the number is reported without any additional letters (for example if the value is "8 i" it becomes "8")
    4. Strict tag validation:
      • Must follow patterns like 104-FE-0512, RO-22345, 208-FEO-21312, 1312-FE-21312 (allow arbitrary spacing)
      • Reject P&ID numbers (EPCC07-MEIL-303-PRS-PID-000-0007-1)
      • Do not extract overly long sequences as tag numbers
      • Discard duplicates
    5. Standardize units by using logical reasoning. Sometimes the table data might have additional characters in the unit (for example mmH2O 4°C becomes mmH2O).

    Note - Use the page number given in the JSON example below, do not search for it in the table, its not present. Emit only the following JSON array, with no extra text or comments:

    {{ "tag": "<TAG_NUMBER>", "page_num" : {pnum},

      "Parameter1": "<value_or_NA>",
      "Parameter2": "<value_or_NA>",
      "Parameter3": "<value_or_NA>",
      …
      "Parametern": "<value_or_NA>"
    

    }},

    Constraints:

    • Strict JSON formatting.
    • All parameters from the reference list must appear for each tag. No additional paramters should be added. Make sure to match the reference list parameters exactly.
    • Fill missing values with "NA".
    • No additional output (no commentary, no logs) beyond the JSON array.

  2. Assistant

    Certainly! Here's an optimized, advanced prompt engineered for precise and accurate data extraction from your input using an LLM. It emphasizes stepwise reasoning, strict matching, and clear output formatting to maximize extraction quality:


    Table Data and surrounding text
    {table_text}
    Table Data and surrounding text end

    Parameter List
    {param_list}
    Parameter List ends

    ---TABLE STRUCTURE---
    The table data is structured as a list of lists of lists (table → row → cell). For a single table, it is a list of lists (row → cell).

    ---SYSTEM INSTRUCTIONS---
    Task Context
    You are a JSON data extractor analyzing tabular data containing equipment specifications. Your goal is to extract values strictly from the provided parameter list with precise matching logic.

    Core Constraints (Follow ALL exactly):

    1. Use step-by-step reasoning to ensure all instructions are followed completely.
    2. Parameter matching priority:
      • Exact name match only (e.g., "Wall Thickness" ≠ "Plate Thickness")
      • Recognize common abbreviations (e.g., Number → No., temperature → temp)
      • No partial matches (e.g., "Thickness" alone is invalid)
    3. Extract units only if the parameter name ends with "Unit" in the parameter list.
    4. For purely numeric values, extract only the numeric part, stripping any letters or symbols (e.g., "8 i" → "8").
    5. Tag validation rules:
      • Accept tags matching patterns like 104-FE-0512, RO-22345, 208-FEO-21312, 1312-FE-21312 (allow arbitrary spacing).
      • Reject P&ID style tags (e.g., EPCC07-MEIL-303-PRS-PID-000-0007-1).
      • Discard overly long sequences as tags.
      • Remove duplicate tags.
    6. Standardize units by removing extraneous characters or temperature references (e.g., "mmH2O 4°C" → "mmH2O").
    7. Use the provided page number {pnum} in the output JSON; do not search for it in the table.

    Output Requirements:

    • Emit only a JSON array of objects, one per unique valid tag.
    • Each object must have:
      • "tag": the validated tag string
      • "page_num": the given page number {pnum} (integer)
      • All parameters from the parameter list as keys, with exact names and values or "NA" if missing
    • No extra parameters beyond those in the parameter list.
    • No commentary, no logs, no extra text.
    • Strict JSON formatting.

    Example output format:

    [
      {
        "tag": "104-FE-0512",
        "page_num": 5,
        "Wall Thickness": "8",
        "Temperature": "NA",
        "Pressure Unit": "bar"
      },
      {
        "tag": "RO-22345",
        "page_num": 5,
        "Wall Thickness": "NA",
        "Temperature": "120",
        "Pressure Unit": "NA"
      }
    ]
    

    Begin extraction now.

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