This repository contains all the source assets related to Hill Space is All You Need.
This repo contains a general training script that I used for research while writing the paper. It's not used directly in the experiments, but has some other features that might be interesting but didn't make it into the paper.
The default configuration trains all the Arithmetic and Trigonometry operators talked about in the paper. It uses hill space with snapping, and logs extensive metrics to Weights and Biases.
python -m hillspace.trainSome interesting features that didn't make it are:
- There are MANY operators I didn't manage to "solve" for the paper, but haven't revisited with the final model formulation. They could be good starting points for new primitive exploration, etc. (see operator_specs.py)
- I struggled with trying to learn powers, but their optimal weights mostly exist in the "Valley of Sorrow" in Hill Space where they're tightly clustered together near gradient dead zones. There are other formulations of spaces I thought might accomodate those fractional optimal weights better. Perhaps now with all the remaining error accounted for it would be worth exploring them again.
We conducted 5 experiments in the paper to demonstrate Hill Space's unique properties and to back up the rather bold claims we make about precision and what error remains in our method.
NOTE: Experiments 3-5 all have the results from the paper precalculated and will only print them out when run. To reproduce the results yourself you need to go to the bottom of the desired experiment and uncomment the commented out line that calculates the result data for aggregation
python -m hillspace.experiments.experiment_neural_calc 1339.7364 - 2.7364python -m hillspace.experiments.experiment_train_divisionpython -m hillspace.experiments.experiment_inalupython -m hillspace.experiments.experiment_errorpython -m hillspace.experiments.experiment_initThe visualizations in the paper comes from both Python scripts that output images, and a set of React widgets that export SVGs for each mathematical primitive.
This figure maps Hill Space into a 3d image to help users understand the hill shape it produces, and how the inputs relate to locations in the space.
python -m hillspace.figures.hill_space_visualizationThis figure demonstrates visually how the tanh and sigmoid functions interact to produce constrained weights. It highlights how tanh acts to select the signal, and sigmoid gates it up or down.
python -m hillspace.figures.activation_visualizationAll four primitives introduced in the paper are visualized using React widgets that save PNG and SVG renderings for external use, and provide an interactive experience to allow a more intuitive way of digesting what's happening.
Open the desired file in your web browser to interact with the widgets, and click "Download PNG" or "Download SVG" if you want to capture a particular configuration.
open web/additive_primitive.htmlopen web/exponential_primitive.htmlopen web/unit_circle_primitive.htmlopen web/trigonometric_products_primitive.html- Code: MIT License (see LICENSE.md)
- Paper contents and documentation: CC-BY 4.0
If you use Hill Space in your research, please cite:
@misc{dujardin2025hillspace,
author = {DuJardin, Justin},
title = {Hill Space is All You Need},
year = {2025},
month = {7},
howpublished = {\url{https://github.com/justindujardin/hillspace}},
note = {Preprint submitted to TechRxiv}
}Justin DuJardin. "Hill Space is All You Need". July 2025. GitHub repository: https://github.com/justindujardin/hillspace. Preprint submitted to TechRxiv.
Note: If you're interested in sponsoring this work on arXiv, please reach out.
