Find answers from the community

Updated last year

Is there any way to control how the LLM

At a glance

The post asks if there is a way to control how the LLM (Large Language Model) uses the source_nodes, as the response generated sometimes hallucinates names or properties, even when the source_nodes are accurate. The community members suggest several approaches:

1. Using the response synthesizer to control how the source_nodes are handled, and passing a custom one.

2. Using metadata to look for particular properties that exist in all documents.

3. Using the node postprocessor to control how the source_nodes are used.

4. Using the evaluation modules to help combat hallucinations.

The community members also discuss how to instruct the LLM to look at particular metadata fields, such as the title field, instead of generating names.

Useful resources
Is there any way to control how the LLM uses the source_nodes? I sometimes find that source_nodes are accurate, but the response generated hallucinates names or properties. Can we force the engine to look for particular properties that we know exist in all documents?
T
c
8 comments
You might also find the node postprocessor helpful for controlling how the source_nodes are used: https://gpt-index.readthedocs.io/en/stable/core_modules/query_modules/node_postprocessors/root.html
One good way to help combat those types of hallucinations is using the evaluation modules:

https://gpt-index.readthedocs.io/en/stable/core_modules/supporting_modules/evaluation/root.html
Thanks for sending these docs over. How can I instruct the LLM to look at particular metadata fields. The doc you sent doesn't necessarily specify how to include that in the output
Could you specify a bit? Do you mean filtering based on metadata or passing it to the LLM?
Because if you mean metadata filtering, some index types support it for example Pinecone and Chroma
I mean include the fields in the response. Sometimes the LLM makes up names instead of looking at the title field in the nodes. I'd rather it just use the exact string available there
Add a reply
Sign up and join the conversation on Discord