AI Techniques

AI techniques are somewhat similar to AI guidelines. They are also reusable chunks of instructions copied into the prompt. The difference is that guidelines are always copied into the prompt, while techniques are only copied when the prompt explicitly references them.

You can define techniques via the AI->Manage Techniques command:The technique editor is very similar to the guideline editor, so you can check the Guidelines documentation to get a better overview of it.

Typical Use

Techniques typically contain long, detailed instructions now to accomplish a common non-trivial task. E.g. our code base has numerous custom WPF controls that define their own properties:

public Brush LinkForeground
{
    get { return (Brush)GetValue(LinkForegroundProperty); }
    set { SetValue(LinkForegroundProperty, value); }
}

public static readonly DependencyProperty LinkForegroundProperty = DependencyProperty.Register("LinkForeground", typeof(Brush), typeof(AdvancedScopePresenter), new PropertyMetadata(null));

We are gradually porting it to run on Linux and Mac, and that involves changing these properties to a slightly different class:

public Brush LinkForeground
{
    get => LinkForegroundProperty.GetValue(this);
    set => LinkForegroundProperty.SetValue(this, value);
}

public static readonly StyledProperty<Brush> LinkForegroundProperty = PortablePropertyFactory<Brush>.Register<AdvancedScopePresenter>(nameof(LinkForeground));

It almost looks like you could use a regular expression to convert it, but that path is thornier than it seems:

  • Sometimes, it’s Register(“LinkForeground”), other times it’s Register(nameof(LinkForeground)).
  • Things like Brush need to be converted to IBrush
  • Sometimes properties define special metadata, that needs to be converted portable property flags

So instead, we have an AI technique called “Converting WPF properties“. It’s fairly verbose (almost 2KB of text) so it makes no sense to include it in every prompt. All it takes now is pointing to a class with some WPF properties and saying: “convert properties per @styledprop“:

The expanded prompt going into the model looks like this:

# Editing instructions
Convert properties per "Converting WPF Properties" technique
# Converting WPF Properties
<detailed instructions how to convert them>

You don’t need a very smart model to follow straight-forward detailed instructions, so Llama 3.3-70B running on Cerebras hardware churns through a 15-kilobyte source file in mere 1.7 seconds:You can also perform very common edits without writing any prompt at all by using Quick Edit Templates.