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}
}

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.6.tar.gz (8.1 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.6-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for multiscreen-0.1.6.tar.gz
Algorithm Hash digest
SHA256 962f0f0b0b0e4288e555dcb04861e03cb792deb32d94eed9486ca91faf1531af
MD5 af7329ea0fb3cb917d016963474a7edc
BLAKE2b-256 20e151367430c09d1fb03bc408dd29892913af4f8fe10df0a300ac92eb8ce059

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multiscreen-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a87c89cd8e1935af4d1d51e440fb5a8ccb74e8aeccc385b59ac5da7a507cccd1
MD5 0e5cccb881b715d3608d047e0ad600cb
BLAKE2b-256 ac8a49b2c9104a5256a46902f379f2b06c69e5b2d9e33d2e67fe3f6154622f39

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