Training an LLM from scratch on Modal credits
An engineer used available Modal credits to train a large language model completely end to end. The resulting model Malama, named after a beach where many decisions unfolded, is a 1B parameter system. The project was personal rather than commercial—the goal was figuring out whether the full training pipeline could be reproduced independently.
Malama's architecture and training scale
The model uses the GLM tokenizer and Kimi Delta Attention alongside full attention mechanisms. It was pre-trained on 100B tokens before undergoing SFT and reinforcement learning on coding tasks. This configuration probably wouldn't make sense for a commercial product but that wasn't the objective—a practical model wasn't the aim. Malama is fundamentally undertrained for its size because credits were spent on the complete pipeline rather than optimizing the pre-training phase.
The model became competitive on HumanEval and MBPP for its size. On LiveCodeBench it trails newer models even though coding was the trained niche. Training mostly relied on existing datasets, especially those from NVIDIA. The author also incorporated distillation by proxy, using open source repositories showing signs of recent frontier model contributions.
Data quality outweighed architecture choices
The exercise highlighted that good high quality data matters more than model architecture. The author attempted to contribute 1B tokens of EU-published documents but found they made the model worse. Most of those documents were semi-autogenerated with substantial low information boilerplate. This experience updated the author's bias: future breakthroughs will likely come from finding high information density data pools or improving sample efficiency on existing data, not from novel architectures or techniques.
Training felt like science more than art
Initial size and training token estimates, then watching results emerge, felt like training models is more science than art. The author deliberately defined training as workflows of a particular form to explore the space of ideas—this required taking on complexity that enabled the pieces to fit together.
It was striking how the model progressed from gibberish to slowly forming sentences and more complex answers as parameter count and pre-training tokens increased. This felt like noise coalescing into a clear picture. Both attention and state space models feel like very pure articulations of reasoning. The author was especially surprised to find that KDA (Kimi Delta Attention) is a descendant of SSMs (State Space Models) and attention mechanisms.
Agents explored the space of ideas
It was a delight how agents could help formulate experiments and side quests, running them quickly on Modal. For instance, the author tested making an earlier version a looped model—there was no benefit since problems were still in the pre-training phase, not reasoning changes. Models also proved very good at writing custom kernels given a verification function, which improved speed across all parts of the process.
Code snippets from evaluation logs
The author shared two unedited passing generations from Malama v0.0.1, taken from evaluation logs in jfrick/lm-exploration-results. These demonstrate the model's capability on specific coding prompts.
X = int(input())
total_sum = 0
sum_x = 0
for i in range(1, 10):
for j in range(1, 10):
val = i * j
total_sum += val
if val == X:
sum_x += val
answer = total_sum - sum_x
print(answer)
Prompt: Given an integer X, find the sum of all integers in the 9×9 multiplication table that are not equal to X.
def mean_absolute_deviation(numbers):
if not numbers:
return 0.0
mean = sum(numbers) / len(numbers)
total_diff = 0
for num in numbers:
total_diff += abs(num - mean)
return total_diff / len(numbers)
Prompt: For a given list of input numbers, calculate the Mean Absolute Deviation around the mean of this dataset.
Acknowledgements
Thanks to Modal for providing credits and, more importantly, easy to use infrastructure. Appreciation also goes to many people working on open source LLMs who contributed to the shared understanding of how to create these models, especially the new crop of open source neo labs: Thinking Machines, Mirendil, Recursive, Ricursive, Flapping Airplanes, and Open Athena / Marin.