Language-model proposals#
Large language models as proposal generators for equation discovery.
Recent work uses large language models (LLMs) to propose equation skeletons from scientific context and the current best fits, while a numerical optimizer fits the constants: in-context symbolic regression (Merler et al., 2024), LLM-SR (Shojaee et al., 2025) and concept-guided search (Grayeli et al., 2024).
eqdisco supports this without depending on any LLM service. A proposer is any
callable proposer(prompt: str) -> str; it can wrap the client library of any
provider. This module builds the prompt from the variables, their meaning, a data
summary and the best equations so far, parses the answer into expressions with
free constants, and fits them:
TemplateProposer– an offline proposer drawing from templates (for tests, teaching and as a knowledge-based baseline);LLMGuidedRegressor– the iterative loop of prompt, proposals, constant fitting and feedback. The proposer can also be given toSymbolicRegressor(llm_proposer=), which injects the proposals into its population.
Proposals are treated as untrusted text: they are parsed by SymPy into the restricted expression language of eqdisco and never executed.
Prompt construction, safe parsing and the LLM-guided regressor.
Classes#
|
Offline proposer that answers with templates (no language model). |
|
Iterative equation discovery with a proposer (LLM or templates) and constant fitting. |
Functions#
|
Prompt that asks for |
|
Parse an answer into expressions; constants |
|
Ask the proposer for |