Skip to main content

Implementation of MultiScreen

Project description

MultiScreen

Implementation of Multiscreen proposed by Ken Nakanishi for Screening is Enough

Basically it is a non-softmax attention with ReLU squared activation, content similarity thresholding, and aggressive normalization of the values.

Install

$ pip install multiscreen

Usage

import torch
from multiscreen import MultiScreen

multi_screen = MultiScreen(
    num_tokens = 256,
    dim = 512,
    depth = 6,
    heads = 8,
    dim_keys = 16,     # paper says 16 or 32
    dim_values = 64    # paper says 64 or 128
)

token_ids = torch.randint(0, 256, (1, 1024))

logits = multi_screen(token_ids)
assert logits.shape == (1, 1024, 256)

Enwik8

$ uv run train.py

Citations

@misc{nakanishi2026screening,
    title   = {Screening Is Enough},
    author  = {Ken M. Nakanishi},
    year    = {2026},
    eprint  = {2604.01178},
    archivePrefix = {arXiv},
    primaryClass = {cs.LG},
    url     = {https://arxiv.org/abs/2604.01178},
}
@misc{zhang2021sparse,
    title   = {Sparse Attention with Linear Units},
    author  = {Biao Zhang and Ivan Titov and Rico Sennrich},
    year    = {2021},
    eprint  = {2104.07012},
    archivePrefix = {arXiv},
    primaryClass = {cs.CL}
}
@misc{horuz2025resurrectionrelu,
    title   = {The Resurrection of the ReLU},
    author  = {Coşku Can Horuz and Geoffrey Kasenbacher and Saya Higuchi and Sebastian Kairat and Jendrik Stoltz and Moritz Pesl and Bernhard A. Moser and Christoph Linse and Thomas Martinetz and Sebastian Otte},
    year    = {2025},
    eprint  = {2505.22074},
    archivePrefix = {arXiv},
    primaryClass = {cs.LG},
    url     = {https://arxiv.org/abs/2505.22074},
}

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

multiscreen-0.1.7.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

multiscreen-0.1.7-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file multiscreen-0.1.7.tar.gz.

File metadata

  • Download URL: multiscreen-0.1.7.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.13

File hashes

Hashes for multiscreen-0.1.7.tar.gz
Algorithm Hash digest
SHA256 d6f97ac5ad760c63ccb04f74c0412019ff30b4fa4518fdf8debcc58aeea94a82
MD5 2224fc0fb9779c6f6ab59107fa4b4e87
BLAKE2b-256 2e8a5c980ed1a51aeabf3c3a05e59ca95109f4e5881ca358a3d8c9504c4458b4

See more details on using hashes here.

File details

Details for the file multiscreen-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for multiscreen-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 93fd66fe1b864f6b5fb30cf0cba26f4840285f3a4b0d987c9c2ae201d4b39762
MD5 3b66cb3e9b5053ce2eb5d2d4b8d94b12
BLAKE2b-256 d96ed63eeb64328fb3745cdb458c874c63d8e3c6149a40ec429d7a7b99a51dae

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