Python · Machine learning · Experiments

Experimenting with Poe's Python Interpreter

A tiny interpreter, a handful of neural networks, one very confused Markov chain, and a surprisingly affordable price tag.

Field notes / 001

How much can you do with a Python box?

I found a little Python interpreter on Poe and, naturally, started throwing machine-learning experiments at it.

I recently discovered Python, (they really could've thought of a better name) a Python interpreter bot on Poe by the official @poe account, and decided to see how much I could actually do with its environment.

I ended up going down a pretty interesting rabbit hole.

Using Python 3.11 and PyTorch, I ran several experiments entirely inside the interpreter, without needing to set up my own Python environment.

Machine Learning Libraries

The bot's description advertises several preinstalled libraries, including:

  • PyTorch: Neural networks and deep learning.
  • TensorFlow: Another major deep learning framework.
  • scikit-learn: Traditional machine learning.
  • NumPy and SciPy: Numerical computing and scientific operations.
  • Pandas: Working with datasets.

There are also around 150 other commonly used Python libraries advertised. (but it doesn't list which ones specifically)

One issue: TensorFlow was listed in the description, but it just.. didn't work.

Neural Network Experiments

I trained a small neural network to classify different datasets. Here's how it performed on completely separate test examples:

0%Quadrant classification
0%Interleaving spirals
0%Noisy spirals

Unseen test accuracy

Measured results
Quadrant classification
99.68%
Interleaving spirals
100.00%
Noisy spirals
99.00%

Each model was evaluated on a separately generated test set. These are synthetic classification tasks, not real-world benchmarks.

The spiral experiment was particularly interesting. A network with only 33,666 parameters learned to distinguish two interleaving spirals, achieving 100% accuracy on 10,000 independently generated test examples.

# The tiny spiral classifier
Parameters 33,666
Training examples 20,000
Unseen test examples 10,000
Test accuracy 100.00%

Markov Chain Test

I also built a tiny character-level Markov chain.

It learned character patterns from a short training corpus and generated its own text.

The results were... questionable.

It could produce recognizable phrases, but also said things like "wantered learnings." Not exactly Shakespeare.

# A small sample of its literary genius
the robot explored internet. the little robot kept
the little robot read everesting. one day the robot
was full of books computer wan

A Few Environment Discoveries

I investigated the interpreter's environment and found:

Runtime

Python 3.11.18

PyTorch 2.0.1, along with NumPy, SciPy, scikit-learn, pandas, and other advertised libraries.

Compute

17 logical CPUs

Visible to Python, with approximately 1.76 GiB of visible system memory.

Graphics

No CUDA GPU

PyTorch was installed with CUDA support, but no GPU was accessible to the runtime.

Networking

Restricted access

Standard outbound DNS and internet access were largely unavailable in my tests.

I also ran CPU benchmarks and got some surprisingly fast matrix multiplication results.

The Pricing

$0.000030Per script execution (1 Poe point)
60 secExecution timeout

Here's another interesting detail: it's only $0.000030 per script execution, or 1 Poe point.

That's incredibly inexpensive for experimenting with Python, especially when you consider that you can use libraries like PyTorch without setting up your own environment.

The interpreter has a 60-second execution timeout. Any script that runs longer than that gets terminated. Resource limits are another thing worth investigating.

Each script execution costs 1 Poe point ($0.000030). The execution timeout is 60 seconds.

What's Next?

I want to take this further by building a tiny neural language model, eventually experimenting with a miniature Transformer architecture.

It's been a fun reminder that you don't necessarily need a dedicated machine-learning workstation to start experimenting with neural networks.

Sometimes all you need is a Python interpreter and an insane amount of curiosity.