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.

Answered by DTS Engineer in 861805022

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

Accepted Answer

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 😀

@EduardoDominguez If I understand correctly, you're noting that Foundation Models is able to see the structure of your generable type, and you are asking if this means that guides are redundant.

Our general advice is this: First, create your @Generable type with just descriptive property names, and see what kinds of values are created. Then, in areas where the model isn't consistently generating relevant data, try adding @Guide to provide additional guidance to the model for generating those values.

With on-device models, reducing complexity and keeping the context window small with succinct instructions is generally preferably, but through experimentation you may find that property-specific guides lead to more consistent results. Remember, building with large language models is all about testing and iterating!

Best,

-J

Thanks -J for your advices.

Avoid hallucinations and information from trainning data
 
 
Q