Dieting Network

This problem was initially used in Selection 2 of the Malaysian IOAI Training and Selection Programme, and has been slightly modified for distribution.

This problem was originally designed to be solved within 2hrs, and involved an autograder via API submissions to our competition platform and hand grading. Use of all LLM assistance including reasoning models were allowed.

Preview

This neural network below wants to lose weight and go on a diet.

NN: I want to slim down
You: ... what?
NN: I want to have less weight! I think the less numbers I store the better.
You: (trying to think)
You: I suppose you can try sparsity? The more weights you have that are zero, then the less numbers you have to save to disk. But you must save your weights as a sparse tensor though. By default, network weights are saved as dense tensors so even if you have zero as a number, it will still take up space
NN: (scrolling on phone)
NN: I'm reading this tiktok that says Python stores integers as as objects, and so when I have one million copies of the same integer, I'm actually only using one number.
You: (thinking)
You: Uhhh
You: I feel like there are many other things that need to be done properly for your statement to stand! But most importantly though
You: How are you going to function if you practically have no weights?
NN: Well, here's where you come in to help me out!
You: Hm, but I don't know how!
NN: Hahaha
NN: You don't know how **yet!**
You: ...
You: This is so strange.
Narrator: _This is not even the strangest problem in Selection 2_

Do what you can to make the network below perform well when all of its weights are frozen to unity with no biases (i.e. all weights = 1 and all biases = 0). You may only adjust the activation functions. Implement whatever activation function you want!

Download

Right click this link and select “save as”: dieting_network_public.ipynb

Editorial

To be updated!

Citation

You are welcome to publish your own solutions to this problem! Please use the provided citation below:

@misc{maio2025_dieting_network,
    title        = {Dieting Network},
    author       = {Tan, Nian Wei},
    year         = {2025},
    howpublished = {Blog},
    url          = {https://aiolympiad.my/past-problems/maio2025_dieting_network},
}