0:03 One of the benefits of large language models is 0:05 that they're a lot more flexible than
code. This means they can handle all 0:08 sorts of problems that code or even a
workflow couldn't handle previously. 0:11 When you're using a tool like ChatGPT or Claude
and can give feedback on what the LLM produces, 0:16 this flexibility and creativity is an asset. 0:18 However when you're trying to
integrate AI into an existing system, 0:21 this type of variable output
can actually be a liability. 0:24 For example, if you have an AI block
in a workflow you likely need the 0:27 LLM to produce a reasonable answer in one
shot, without the chance to give feedback. 0:31 This means you need more
consistent output from your LLMs. 0:34 Luckily there are a few different
ways to leverage LLMs and still get 0:37 consistent output that can augment and
even control your apps and workflows. 0:41 Let's take a look at some of your options. 0:42 One of the easiest ways to get more
consistent output is to adjust the 0:45 temperature that you're using to prompt your LLM. 0:48 Lower values of temperature produce
more focused and deterministic output, 0:51 while higher values produce more random
output. Lowering the temperature means 0:55 you'll get more consistent output from your
prompt even if you don't change anything else. 0:59 LLMs are pretty great at interpreting
natural language, but you should still 1:02 distinguish which part of your input
is the instructions for the model and 1:06 which part is the contextual data that
it can use to help generate its output. 1:10 Providing delimiters between instructions and data 1:12 provided for context can help
the LLM tell the difference. 1:15 Delimiters can be anything from triple quotes, 1:17 to backticks to labeling the
various sections of your prompt. 1:21 Another technique that's very effective
is wrapping your data in semantic tags. 1:25 For example we're asking the AI to summarize a
given passage, we can wrap the actual text in 1:30 a tag called <text_to_summarize>, which helps
the LLM separate this from our instructions. 1:35 You can ask an LLM to output information
to you using these same tags. 1:39 This allows you to distinguish
between the LLM explaining the 1:41 output and the actual portion of
the output that you care about. 1:45 A nice side effect is that you can then
use a regex to parse out the output you 1:48 actually care about and use it in
your apps and workflows regardless 1:51 of if the LLM's explanation
or other output text changes. 1:55 LLMs are also pretty good at outputting other
structured formats they're familiar with, 1:59 especially if they have a few examples. 2:00 Here we're asking the language model to output 2:02 JSON and giving it an example of
the type of JSON object we expect. 2:06 LLMs are powerful tools that unlock
an entirely new set of capabilities. 2:10 In a future video we'll take a
look at how to actually apply 2:13 these techniques in your apps and workflows. 2:15 See you next time!