symbolic-equation
lingzhi227/agent-research-skills
Discover interpretable scientific equations from data using LLM-guided evolutionary search.
What is symbolic-equation?
This skill uses a multi-island evolutionary algorithm guided by an LLM to automatically discover symbolic equations that fit your data. It's designed for symbolic regression tasks where you want human-readable mathematical formulas rather than black-box models.
- Multi-island evolutionary algorithm with independent populations for diversity
- Softmax-based cluster sampling with temperature scheduling for exploration/exploitation balance
- LLM-proposed equation mutations that generate improved versions from top performers
- Automatic parameter optimization via scipy BFGS or Adam
- Island reset mechanism to maintain diversity and escape local optima
- Fitness evaluation with timeout protection and Occam's razor preference for simpler equations
How to install symbolic-equation
npx skills add https://github.com/lingzhi227/agent-research-skills --skill symbolic-equation- Dataset with labeled input variables and target output
- Physical context or domain knowledge about the problem
- Understanding of the variables' types and ranges
- Fitness metric definition (typically negative MSE)
How to use symbolic-equation
- 1.Define your problem specification with input variables, output variable, and evaluation function
- 2.Describe the physical context and domain knowledge in the dataset description
- 3.Initialize the multi-island buffer (default 10 islands)
- 4.Run the evolutionary search loop, which iteratively samples equations, proposes improvements via LLM, and evaluates fitness
- 5.Monitor convergence; the algorithm periodically resets bottom-performing islands to maintain diversity
- 6.Extract and rank the best equations from all islands by fitness score
- 7.Simplify and interpret the top candidates with physical meaning
Use cases
- Discovering physical laws from experimental data (e.g., damped oscillator dynamics)
- Finding interpretable regression models for scientific datasets
- Automating symbolic regression when you have domain knowledge about variables and context
- Generating equation candidates for physics or engineering problems
- Creating human-readable alternatives to neural network predictions
- Scientists and researchers doing equation discovery
- Engineers analyzing experimental or simulation data
- Physics students exploring symbolic regression
- Anyone needing interpretable mathematical models instead of black-box predictions
symbolic-equation FAQ
Any equation using standard mathematical operations (+, -, *, /, powers, trigonometric, exponential, logarithmic functions). No recursive equations are allowed. Parameter optimization is handled automatically.
Pass a dataset description with variable names, types (e.g., np.ndarray), and physical context. The skill uses this to construct prompts and guide the LLM's equation proposals.
Every 4 hours (default), the bottom 50% of islands are reset and seeded with the best equation from surviving islands. This maintains population diversity and helps escape local optima.
After search completes, all islands' best equations are ranked by fitness score (negative MSE). Simpler equations are preferred when fitness is similar (Occam's razor).
Yes, any domain where you want interpretable symbolic equations. Provide relevant domain knowledge in the physical context to guide the LLM's proposals.
Full instructions (SKILL.md)
Source of truth, from lingzhi227/agent-research-skills.
name: symbolic-equation description: Discover scientific equations from data using LLM-guided evolutionary search (LLM-SR). Multi-island algorithm with softmax-based cluster sampling, island reset, and LLM-proposed equation mutations. Use for symbolic regression and equation discovery. argument-hint: [data-and-variables]
Symbolic Equation Discovery
Discover interpretable scientific equations from data using LLM-guided evolutionary search.
Input
$0— Dataset description, variable names, and physical context
References
- LLM-SR patterns (prompts, evolution, sampling):
~/.claude/skills/symbolic-equation/references/llmsr-patterns.md
Workflow (from LLM-SR)
Step 1: Define Problem Specification
Create a specification with:
- Input variables: Physical quantities with types (e.g.,
x: np.ndarray,v: np.ndarray) - Output variable: Target quantity to predict
- Evaluation function: Fitness metric (typically negative MSE with parameter optimization)
- Physical context: Domain knowledge to guide equation discovery
# Example specification
@equation.evolve
def equation(x: np.ndarray, v: np.ndarray, params: np.ndarray) -> np.ndarray:
"""Describe the acceleration of a damped nonlinear oscillator."""
return params[0] * x
Step 2: Initialize Multi-Island Buffer
- Create N islands (default: 10) for population diversity
- Each island maintains independent clusters of equations
- Clusters group equations by performance signature
Step 3: Evolutionary Search Loop
Repeat until convergence or max samples:
- Select island: Random island selection
- Build prompt: Sample top equations from clusters (softmax-weighted by score)
- LLM proposes: Generate new equation as improved version
- Evaluate: Execute on test data, compute fitness score
- Register: Add to island's cluster if valid
Step 4: Prompt Construction
Present previous equations as versioned sequence:
def equation_v0(x, v, params):
"""Initial version."""
return params[0] * x
def equation_v1(x, v, params):
"""Improved version of equation_v0."""
return params[0] * x + params[1] * v
def equation_v2(x, v, params):
"""Improved version of equation_v1."""
# LLM completes this
Step 5: Island Reset (Diversity Maintenance)
Periodically (default: every 4 hours):
- Sort islands by best score
- Reset bottom 50% of islands
- Seed each reset island with best equation from a surviving island
- Restart cluster sampling temperature
Step 6: Extract Best Equations
After search completes:
- Collect best equation from each island
- Rank by fitness score
- Simplify if possible (algebraic simplification)
- Report with physical interpretation
Cluster Sampling
Temperature-scheduled softmax over cluster scores:
temperature = T_init * (1 - (num_programs % period) / period)
probabilities = softmax(cluster_scores / temperature)
- Higher temperature → more exploration
- Lower temperature → more exploitation of best clusters
- Within clusters: shorter programs are preferred (Occam's razor)
Rules
- Equations must use only standard mathematical operations
- Parameter optimization via scipy BFGS or Adam
- Fitness = negative MSE (higher is better)
- Timeout protection for equation evaluation
- No recursive equations allowed
- Physical interpretability is preferred over pure fit
Related Skills
- Upstream: data-analysis, math-reasoning
- Downstream: paper-writing-section
- See also: algorithm-design
Related skills
More from lingzhi227/agent-research-skills and the wider catalog.

table-generation
Generate publication-quality LaTeX tables from experimental results with booktabs styling and bold best results.

algorithm-design
Design algorithms with LaTeX pseudocode and UML diagrams for formal method documentation.

atomic-decomposition
Decompose research papers into atomic concepts with bidirectional math-to-code mapping.

backward-traceability
Make every number in your PDF traceable to the exact code line that produced it.

linkfox-multimodal-recognize-image
基于多模态AI的图片识别与分析。当用户想分析、描述、从图片URL中提取信息、image recognition, image analysis, image description, image content understanding, OCR text recognition, visual Q&A时触发此技能。当用户提到图片识别、图片分析、图片描述、识别图片内容、分析产品图、从图片中读取文字、描述图片、提取视觉内容或理解照片内容时触发。当用户提供图片URL并就其视觉内容提问时,即使未明确说"图片识别",也应触发此技能。

anti-render
Generate ideal-vs-reality visual comparisons by analyzing images and creating side-by-side contrasts.