Skip to main content

Mixture of Convex Experts (MiCE) for PyTorch

Project description

MiCE (Mixture of Convex Examples)

What is MiCE?

MiCE is a lightweight PyTorch library for building convex large language models via a series of novel mechanisms. Instead of softmax routing or hard top-k gating, MiCE seeks to apply fusing, kernels, convex embedding, atlas lookups, intrinsically convex neural networks and convex norms.

Conditioned on the right data, this helps guarantee convexity, interpretability, and efficient compute without exponentials or discrete dispatch.

Why MiCE?

  • Efficiency
    No softmax, no log-sum-exp,no MLP, very little to no concavity anywhere in the model.

  • Interpretability
    Clear regions of dominance — visualize arg-max and margins over latent parameters in any 2-D slice.


Feature Comparison

Feature MiCE (MoMx) LogsumEXP MoE Hard MoE Standard MLP
Routing max(mean(…)) LogsumEXP(weights) top-k mask none
Convexity ✅ (vector-valued) ✅ (scalar only)
Atlas inversion optional (invert)
Compute cost ~2.6× MLP >10× (exp/log) ~k× experts baseline
Params ~2.6× MLP high high baseline
Gradient smoothness high (piecewise convex) smooth sparse smooth
Interpretability high medium low low

Installation

pip install torch-mice

import torch
from torch_mice import VectorHull

# Forward-only mode (default):
hull = VectorHull(in_dim=512, petals=8, out_dim=512, invert=False)
y_fwd = hull(x)

# Full atlas mode with exact inversion:
hull_atlas = VectorHull(in_dim=512, petals=8, out_dim=512, invert=True)
y_atlas = hull_atlas(x)

License

Licensed under the Gratis Public License © 2025 Joshuah Rainstar

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torch_mice-0.4.6.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torch_mice-0.4.6-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file torch_mice-0.4.6.tar.gz.

File metadata

  • Download URL: torch_mice-0.4.6.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for torch_mice-0.4.6.tar.gz
Algorithm Hash digest
SHA256 1044a064218f7a70427cb949429210a454f5e6fb2e669f6d3032d5ddbdad3a2b
MD5 5d336f13cd71faa1530cfa7aec6f4b28
BLAKE2b-256 5bc6a32c93c5240925f197bb745b1aedf2beedc3876be9b634b540f8a3ea5602

See more details on using hashes here.

File details

Details for the file torch_mice-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: torch_mice-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for torch_mice-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4453fe9081a3b65a24682897ea71d13e9a0a2561237479d3902857eeec24d74a
MD5 81727d7254368d00a07240db81d19f8e
BLAKE2b-256 df4b62e0225de9ea5412c5b19a7f5305d0bbffa7cd2551f20a6bf7b7f4f7340a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page