AI Revolutionizes Marketing Optimization: Self-Research in Action
Le brief IA que les pros lisent chaque soir
Les 7 actus IA du jour, décryptées en 5 min. Gratuit.
Inclus dès l'inscription : notre sélection des meilleurs guides & comparatifs IA.
Choisis ton rythme
Gratuit · Pas de spam · Désabonnement en 1 clic
AI in the Service of Marketing Optimization
Autoresearch: A New Approach for Marketing Campaigns
In the dynamic world of marketing, ideas for improving a product or campaign are abundant. However, the time and resources to test each idea are often limited. This is where artificial intelligence (AI) comes into play, capable of handling these experiments. AI can conduct dozens, even hundreds, of experiments, eliminating those that fail and refining those that succeed.
Autoresearch is a method that allows a language model (LLM) to operate in a continuous loop, testing and measuring the impact of each experiment. This approach has already proven effective for many professionals, which prompted me to try it personally.
Origin and Development of Autoresearch
Autoresearch was conceptualized by Andrej Karpathy. In his paper, he describes how AI research has evolved. Once, it was conducted by human researchers, amidst meetings and breaks. Today, this task is delegated to autonomous AI agents, operating on massive computing infrastructures.
The idea is to let an LLM operate autonomously, modifying the code, training the model, and evaluating performance. Each change is either kept or rejected, and the process repeats. The ultimate goal is to return to an improved model compared to the initial one.
Practical Case: Optimizing a Marketing Budget
To put autoresearch into practice, I chose to optimize a marketing budget with specific constraints. As a marketing analyst, you need to plan activities for the upcoming month, with a budget limited to $30 million. The goal is to maximize revenue.
Each potential marketing campaign comes with projections: the country, the marketing channel, the required investment, and the expected revenue. Other data includes the number of users acquired and interactions with customer support. This information allows for iteration on the initial task, gradually adding additional constraints.
A Basic Approach to Optimization
To guide the AI agent, it is useful to start with a basic approach. A simple solution is to target the most profitable segments in terms of revenue per dollar spent. Campaigns are sorted according to this criterion, and those that fit within the budget are selected. While this method is rudimentary, it provides a good starting point.
import pandas as pd
df = pd.read_csv('marketing_campaign_estimations.csv', sep='\t')
# --- Baseline: greedy by revenue-per-dollar ---
df['revenue_per_spend'] = df.revenue / df.marketing_spending
df = df.sort_values('revenue_per_spend', ascending=False)
df['spend_cumulative'] = df.marketing_spending.cumsum()
selected_df = df[df.spend_cumulative <= 30_000_000]
total_spend = selected_df.marketing_spending.sum()
revenue_millions = selected_df.revenue.sum() / 1_000_000
assert total_spend <= 30_000_000, f"Budget violated: {total_spend}"
print(f"METRIC revenue_millions={revenue_millions:.4f}")
print(f"Segments={len(selected_df)} spend={total_spend/1e6:.2f}M")
Setting Up pi_autoresearch
Before launching the experiment, it is necessary to install pi_autoresearch. The setup for pi is done via the instructions on pi.dev, and installation occurs with a single command, making the pi coding environment operational locally.
npm install -g @mariozechner/pi-coding-agent # install pi
/login # select the provider and specify the APIKey
Next, the pi-autoresearch extension is installed.
pi install https://github.com/davebcn87/pi-autoresearch
To control the number of iterations and manage costs, a file autoresearch.config.json is created at the root of the repository.
"maxIterations": 30
Starting the Experiment
The experiment can then begin. I launched the autoresearch by calling the dedicated skill.
/skill:autoresearch-create
Autoresearch then attempted to determine the optimization goal. It analyzed the code in optimise.py and generated a file autoresearch.md summarizing the task:
"Improve
optimise.pyto select a set of campaign segments with a maximum total revenue while adhering to the fixed marketing budget of 30,000,000."
The agent then started its experimentation cycle, providing transparency about its reasoning and results.
Brief IA — L'actualité IA en français
L'essentiel de l'actualité de l'intelligence artificielle, décrypté et expliqué chaque jour.