Skip to content

[JS] Description hallucinations when using describe and nullish methods together #538

@ariel-pettyjohn

Description

@ariel-pettyjohn

Describe the bug
Models occasionally hallucinate, about 30% of the time with the below use-case, and add a "description" field when the Zod .describe() method is used.

To Reproduce
I don't know how general this behavior is, and I've only experienced it with this one use-case, so I'll add a screenshot of my code below to help reproduce. This particular application is to extract colors from text by name, RGB array, or hex value. I've tried removing the descriptions and running the flow and haven't encountered this behavior after repeated runs. The input in this case was "green, orange, [0, 46, 226], and #456". In other runs, it's also returned non-null descriptions such as "the color green".

Expected behavior
Because the schema only provides fields for "name", "hex", and "rgb", I'd expect to only receive values for those fields from the model. Otherwise, the output is exactly as expected.

Screenshots
Code:
extract colors

Output with hallucinated descriptions:
hallucinated descriptions

Runtime (please complete the following information):

  • OS: Windows 11 Home Edition

** Node version

  • 20.12.2

Thanks, and hopefully it isn't just user error!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjs

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions