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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for multiscreen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e5cfdee2a2e75469b2d487e51dd6b77f0e965539e3013c0cc162a4f7093ae41
MD5 09edd3e7e2114cb0bfc16c1871b00bd5
BLAKE2b-256 ae7d0cfb677cf7e663bf32e908629b480ae3d8f77ac7bd3304ff836f567f52be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for multiscreen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 417f7f69fbfbe8ba700c0ac59a338b85bf2cb53b47b3816dc308f7b6b2aa6713
MD5 0da98a5b74c5dee450e0753d5876cb92
BLAKE2b-256 c3dc41db6fce3d3b6cd095462ec2c40f2bd3a782c334c7e68333700d7a456af9

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