How pan2013e/dreval works
Project Type & Purpose
• The project is a research evaluation framework meant for replicating experiments on evaluating diverse LLMs (both via OpenAI API and open-source models using vLLM).
• It is structured to handle benchmark data processing, prompt management, model inference, evaluation execution, and concurrent task running.
Main Components
a. Data & Configuration Module:
• “data” Directory: Contains benchmark datasets (e.g., DREval_data.jsonl, DREval_tasks.jsonl) which hold evaluation tasks.
• “model_list.txt”: Lists IDs/URLs of the LLM models used.
• Configuration files (generated and manipulated via evaluation.py’s config command).
b. Prompt Management Module:
• “prompts” Directory: Contains various text templates (e.g., cot_* and direct_* files) for constructing prompts.
• “prompt.py”: Reads these templates and builds concrete prompts during evaluation.
c. Evaluation & Execution Engine:
• “evaluation.py”: The main entry point with modes for configuration creation and execution of experiments.
• “execution.py”, “inference.py”, “dynamics.py”: Likely handle different aspects of running the evaluation process (e.g., how inference is run, tasks are dynamically managed, or program behaviors are analyzed).
d. Task and Experiment Control:
• “taskgen.py”: Handles task generation using the benchmark data, creating inputs for evaluation.
• “batch_run.py”: Allows running tasks concurrently, important for scaling experiments.
e. API Server Component:
• “start_server.sh”: A Bash script that starts a local OpenAI-compatible API server powered by the vLLM library. This module interacts with backend inference services and simulates API calls.
f. Supporting & Utility Scripts:
• “dataset.py” & “test.py”: Provide utility functions and testing frameworks that support the main evaluation workflow.
• “model_list.txt” being an important descriptor for model sourcing.
Relationships & Data Flow
• The Evaluation Engine (evaluation.py) is the central controller. It reads configuration files, invokes prompt construction (via prompt.py) to prepare prompts based on templates, and then uses the generated prompts with the evaluation backend.
• Data from the “data” directory is loaded by modules responsible for building benchmark tasks, as coordinated by taskgen.py.
• When running evaluations, the system may interact with a local API server (initiated by start_server.sh) that acts as an interface to the underlying LLM engines (via vLLM or OpenAI API).
• Batch_run.py enables concurrent execution, managing parallel tasks for faster experimentation.
• Utility modules (e.g., dataset.py, dynamics.py, etc.) support the core evaluation-loop with additional functionalities like state management and runtime behavior analysis.
Architectural Patterns / Design Principles
• Modular Design: Each functional part (data management, prompt generation, execution, API communication) is clearly separated into its own module.
• Separation of Concerns: Frontline evaluation commands, configuration management, and task generation are distinct to simplify testing and experimental reproducibility.
• Extensibility: The prompt management and model interface layers are designed such that new prompt templates or model integrations can be added relatively easily.
• Concurrency: Batch_run.py indicates a design pattern for concurrent or parallel task execution.