Potential-problems

Potential problems

Questions over questions

If the given text itself is a question certain LLM models might decide to answer it which in combination with other parameters can be produce failing results.

For example consider this classifier function that might be used in a conversational agent loop:

my &is-start-over-request = -> $txt, *%args { 
  llm-textual-answer($txt, 'Is the given text an imperative command that asks the process to "start over"? True / False', |%args)
}

If too few tokens are given we get failure:

my $conf = llm-configuration('chatgpt', model => 'gpt-3.5-turbo', max-tokens => 300);
&is-start-over-request("How many filter refinements we did so far?", :echo, :pairs, llm-evaluator => $conf);

One fix is to use more advanced model and/or large number of tokens:

&is-start-over-request("How many filter refinements we did so far?", :echo, :pairs, e => llm-configuration($conf, max-tokens => 4096));

Another fix is to put the question in quotes:

&is-start-over-request("ยซHow many filter refinements we did so far?ยป", :echo, :pairs, e => $conf);

That is why since ver<0.2.6> the function ML::FindTextualAnswer::LLM::TextualAnswer::Function has text separator parameters, sep-text-begin and sep-text-end. By default those separators are Markdown code fences for "text", i.e. ```text and ```, respectively.

ML::FindTextualAnswer v0.2.8

ML::FindTextualAnswer provides function(s) for finding sub-strings in given text that appear to answer given questions.

Authors

  • Anton Antonov

License

Artistic-2.0

Dependencies

JSON::Fast:ver<0.17+>LLM::Functions:ver<0.1.7+>Text::SubParsers:ver<0.1.2+>

Test Dependencies

Provides

  • ML::FindTextualAnswer
  • ML::FindTextualAnswer::LLM::TextualAnswer

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.