1 Analyzing data with large language models

 

This chapter covers

  • An introduction to language models
  • Data analysis with language models
  • Using language models efficiently

Language models are powerful neural networks that can be used for various data-processing tasks. This chapter introduces language models and shows how and why to use them for data analysis.

1.1 What can language models do?

We will start this section with a little poem and an associated picture (figure 1.1) connecting the two main topics of this book, data analysis and large language models:

In the silent hum of the server’s light,
Data flows through the veins of night.
Rows and columns, a structured sea,
With stories hidden, waiting to be free.

Each number sings of pasts untold,
Trends and truths in patterns bold.
And here arrives a curious friend,
A language model, eager to comprehend.

It listens close, with circuits keen,
To turn raw facts into insight unseen.
From scatter plots to sentences clear,
Data’s language is all it can hear.

The figures dance, the texts reply,
As code meets meaning under AI’s eye.
They merge their worlds, a seamless blend,
Where logic and language have no end.

For in this bond, both deep and wide,
Data’s essence finds a guide.
And in the neural net’s embrace,
Data analysis gains a poetic grace.

Figure 1.1 Illustration by GPT-4o, connecting the topics “data analysis” and “large language models”
figure

1.2 What you will learn

1.3 How to use language models

1.3.1 Prompting

1.3.2 Example prompt

1.3.3 Interfaces

1.4 Using language models for data analysis

1.4.1 Using language models directly on data

1.4.2 Data analysis via external tools

1.5 Minimizing costs

1.5.1 Picking the best model

1.5.2 Optimally configuring models

sitemap