Rapid engineering: The key to unlocking the magic of generative AI | Nascom

Machine Learning


We have always relied on different models for different tasks in machine learning. With the introduction of multimodality and large language models (LLMs), this has changed.

Gone are the days when you needed separate models for classification, named entity recognition (NER), question answering (QA), and many other tasks.

Alternate text is not provided for this image

As language models become more and more popular, it becomes important to employ a wide range of strategies and tools to maximize their potential. The most important of these strategies are rapid engineeringThis involves carefully choosing and placing words in a prompt or query to guide the model to produce the desired response. If you’ve ever tried to pull the desired output out of ChatGPT or Stable Diffusion, you’re one step closer to becoming a skilled and agile engineer.

Before transfer learning, different models had to be trained for different tasks and use cases. With the introduction of transformers, transfer learningA few small layers at the edge of the network were all that was needed to adapt the language model to different tasks. Head) and tweak it a bit.

Alternate text is not provided for this image

Transformers and their ideas transfer learning This allowed us to reuse the same core components of the pre-trained transformer model for different tasks by switching the “head” of the model and performing fine-tuning.

Even that approach is outdated today. Why bother changing those last few model layers and going through the whole fine-tuning process when you can encourage the model to do some classification or QA?

Alternate text is not provided for this image

You can perform many tasks using the same Large Language Model (LLM) by simply changing the prompt instructions.

Large Language Models (LLMs) can perform all these tasks and more. These models are trained on the simple concept that given a set of text, the model will output a set of text. One variable here is the input text, the prompt. This means that anyone can become a computer programmer by just talking to a computer.

Everyone is a programmer now. All you have to do is say something to the computer.

In this new era of LLM, prompts are king. Bad prompts produce bad output, and good prompts are unreasonably powerful. Building good prompts is an important skill for anyone building with LLM.

Here are some tips on how to create effective LLM prompts.

Please be specific: The more specific your prompt, the more likely you are to get the result you want. For example, if you wanted to generate a poem about the beauty of nature, you could use the following prompt.

code snippet

Write a poem about the beauty of nature using keywords such as trees, flowers, and sunshine.

Use keywords: Keywords help narrow your results and make them more specific. In the example above, the keywords “tree”, “flower”, and “sun” help ensure that the poems generated by LLM are about the beauty of nature.

Use adjectives and verbs. Adjectives and verbs help add more detail and realism to your prompts. For example, you can use the following prompt to generate a poem about the forest.

Write a poem about the forest using these adjectives: lush, green, mysterious. Use the following verbs: grow, sway, whisper.

experiment: There is no one correct way to create an LLM prompt. The best way to learn how to write effective prompts is to experiment. Try different things to find what works best for you.

With a little practice, you’ll be able to create effective LLM prompts that help you get the results you want.

Going forward, building software systems using LLM will primarily be about writing text instructions. Given the importance of creating these instructions, it’s likely that you’ll need a subset of the above functionality. However, I think it’s only a matter of time before many of these features are integrated into existing tools.

In the meantime, it’s important to understand how prompts work and what makes them effective. Knowing this will allow you to give your model the instructions it needs to do its job well. Good luck!



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *