We formulate differential equation discovery as a code-generation task for Large Language Models (LLMs). This repository introduces a compact, physics-preserving textual representation for fields and their derivatives, and integrates LLMs as oracles within an Evolutionary PDE Discovery (EPDE) meta-learning loop.
Discovering the underlying equations from observed data is a fundamental scientific challenge. Traditional methods can be computationally expensive or require significant expert input. EPDE-LLM combines the power of evolutionary search (via the EPDE framework) with the symbolic reasoning and code-generation capabilities of modern LLMs to efficiently and accurately identify governing equations.
- LLM as an Oracle: Uses an LLM to propose physically plausible candidate terms for the PDE within an evolutionary algorithm.
- Physics-Preserving Representation: A novel text-based representation for encoding field data and derivatives that guides the LLM towards physically meaningful solutions.
- Meta-Learning Loop: Tight integration with the EPDE framework for robust and efficient equation discovery.
- Extensible: Designed to work with various open-source and proprietary LLMs (e.g., GPT, LLaMA, Claude).
- Python 3.9
- Conda or pip
- An API key for the LLM service you wish to use (e.g., OpenAI, Anthropic) - if using a proprietary model
-
Clone the repository:
git clone --recursive https://github.com/ITMO-NSS-team/EPDE_LLM_NeurIPS2026.git
-
Create and activate a Conda environment:
conda create -n epde_llm python=3.9 -y conda activate epde_llm
-
Install the required dependencies:
pip install torch==2.3.1+cu118 torchvision==0.18.1+cu118 torchaudio==2.3.1+cu118 -f https://download.pytorch.org/whl/cu118/torch_stable.html pip install -r requirements.txt
-
Set your LLM API key:
Create creds.py file with API key in it. Use creds_example.py as an example.
The following example shows how to use EPDE-LLM.
There are three main approaches to experiment with:
Uses generative symbolic reasoning where the LLM directly proposes equation structures based on the data representation.
cd pipeline
python pipeline_main.pyThe EPDE framework optimizes equation structures through evolutionary principles, treating each equation as an individual subject to mutation and crossover.
cd epde_experiments
python burgers.py
# Other examples: kdv_sindy.py, wave.py, etc.A hybrid approach where the LLM first generates an initial population of candidate equations, which is then refined by the EPDE algorithm using its evolutionary operations for optimal convergence.
cd epde_llm
python epde_llm_main.pyThis project is licensed under the MIT License - see the LICENSE file for details.