Avoid hallucinations and information from trainning data

Hi

For certain tasks, such as qualitative analysis or tagging, it is advisable to provide the AI with the option to respond with a joker / wild card answer when it encounters difficulties in tagging or scoring. For instance, you can include this slot in the prompt as follows:

output must be "not data to score" when there isn't information to score.

In the absence of these types of slots, AI trends to provide a solution even when there is insufficient information.

Foundations Models are told to be prompted with simple prompts. I wonder: Is recommended keep this slot though adds verbose complexity? Is the best place the comment of a guided attribute? other tips?

Another use case is when you want the AI to be tied to the information provided in the prompt and not take information from its data set. What is the best approach to this purpose?

Thanks in advance for any suggestion.

Hi @EduardoDominguez,

You are correct that it is often a good idea to include a fallback phrase in your Instructions, such as "If the required information is not available, you must respond only with 'There is no data to score'".

These kinds of imperatives can give the model a phrase to latch onto when it's uncertain, and can help to reduce hallucinations.

I think this is what you were asking for clarification on, but if I misunderstood your question, let us know.

Best,

-J

Thanks a lot for your super-fast advice! My results have increased quality.

I only need a bit more of information about when is a best practique incorporate a description for a Guided attribute.

@Generable struct SearchSuggestions { @Guide(description: "A list of suggested search terms", .count(4)) var searchTerms: [String] }

Listening the WWDC25 session "Deep dive into Foundation Generation Models" from min 9:00 to 9:15:

Multiline

Foundation Models will even automatically include details about your Generable type in the prompt, in a specific format that the model has been trained on. You don’t have to tell it about what fields your Generable type has

BlockQuote

I interpret that with an auto-descriptive name to the attribute like "SearchSuggestions" write a description is overwork because the model already may infer what must be the content. Am I right?

If my state is true, go deeper and learn what must be set in the description. Some examples would be the best to set clearly best practiques 😀

Avoid hallucinations and information from trainning data
 
 
Q