A 30-Second LLM Load Time on a 4 GB Android Phone: What Neykosa's Experiment Reveals

2 min read

I've been following Neykosa's work, and I was excited to see what their experiment would reveal about running LLMs on a 4 GB Android phone. Neykosa recently conducted an experiment on running large language models (LLMs) on a 4 GB budget Android phone, the Galaxy A05s.

Neykosa used the Galaxy A05s, which has a 4 GB RAM and a quad-core processor, to measure the speed and whole-app latency of LLMs. The experiment involved running several popular LLMs, including Neykosa's own model, on the device and measuring their performance.

python
import time

# Test the speed of the LLM
start_time = time.time()
llm_process = subprocess.Popen(['python', 'llm.py'])
llm_process.wait()
end_time = time.time()
print("LLM speed: ", end_time - start_time, "seconds")

The results showed that the Galaxy A05s can run LLMs, but with limitations. For example, the 7B model took 30 seconds to load, while the 1B model took only 10 seconds. This suggests that the device's 4 GB RAM is a bottleneck, limiting the performance of larger models.

LLM Load Time
1B Model10seconds7B Model30seconds
Data from the sources listed below.

Neykosa's experiment highlighted the importance of model size and complexity. The results showed that smaller models, like the 1B model, performed better on the device, while larger models, like the 7B model, struggled to load and run efficiently.

This experiment is a valuable example of how to run LLMs on budget Android devices, and I believe Neykosa's findings have implications for our own research into model optimization. While the results are promising, they also highlight the limitations of these devices. In the future, we may see more optimized models and devices that can handle the demands of LLMs.

Try this

Want to try running an LLM on your own device? You can use the following command to install the required dependencies:

bash
pip install transformers

Then, you can use the following code to test the speed of an LLM:

bash
python -c "import torch; from transformers import AutoModelForCausalLM; model = AutoModelForCausalLM.from_pretrained('model_name'); model()"

Replace 'model_name' with the name of the LLM you want to test.

Sources