Skip to content

Potential bug in parsing LLM suggestions #63

@jyothis-fp

Description

@jyothis-fp

I am trying LaSR on a dataset from the LLM-SRBench repository. The ground truth equation is $v = -c \cdot \sqrt{1 - \frac{m_0^2}{m^2}}$. My llm_options is:

  active: True
  weights: {'llm_mutate': 0.0, 'llm_crossover': 0.0, 'llm_gen_random': 0.01}
  num_pareto_context: 3
  api_key: [HIDDEN]
  model: gpt-4.1
  prompt_evol: True
  prompt_concepts: True
  llm_recorder_dir: 'log/'
  prompts_dir: 'prompts/'
  llm_context: 'Find an equation that describes the object's velocity (v), given physical input variables: the relativistic mass of an object (m), the object's rest mass (m_0), the speed of light (c).'
  var_order: {'v': 'v', 'm': 'm', 'm_0': 'm_0', 'c': 'c'}
  idea_threshold: 30
  api_kwargs: {'max_tokens': 4096, 'url': 'https://api.openai.com/v1/'}
  http_kwargs: {'retries': 5, 'readtimeout': 360}

There seems to be a mismatch between LLM output and the equation that LaSR generates as a result. The LLM suggests v = c / sqrt((m / m_0)^2 - 1), but LaSR seems to take it as cos(c / sqrt(((m / m_0) ^ 2.0) * 1.0)). I am attaching the llm_calls log here. The log contains the usual llm input and output, as well as candidate equations (raw expressions from the llm output) and accepted expressions (expressions after parsing). I have added thread id to each item for disambiguation.

Caveat: I am not sure if my var_order is causing the issue.

llm_calls.txt

@MilesCranmer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions