TACT

Ternary Action-Calling Transformer

A language model for function calling in 2.39 MB

TACT reads a request in plain language together with the list of functions a device offers and returns the calls that carry the request out. On device-control tests it is more accurate than open models up to 700 times its size.

Weights
2.39 MB
Parameters
7.4 million
Mean accuracy on device control
80.3 %
One of TACT's weight matrices at full size. 512 × 512 weights, each −1, 0 or +1.

Demo

Runs locally in your browser.

Device
Its functions
    Calls returned by the model
    Speed
    –
    Answer
    –
    Function list read
    –

    Loading the model…

    Comparison with open function-calling models

    The chart places TACT and nine open function-calling models by the size of their weights and by their mean accuracy on four device-control test sets.

    All numbers

    Accuracy in percent. A request counts as correct when the output calls equal the reference calls in names and in every argument value. The four sets hold 2014 requests over 196 devices, and three of the sets were written independently of the training data.

    How the model fits in 2.39 MB

    The size comes from three design choices that are used together.

    Ternary weights

    Every weight of the linear layers is −1, 0 or +1 and is stored in 2 bits. The inputs of the linear layers use 8 bits and the embedding uses 4 bits.

    one block × 6 to read · × 4 to write

    One block applied repeatedly

    The encoder is one block applied six times and the decoder is one block applied four times, which gives the model the depth of ten layers with the weights of two.

    function list request calls once each time

    Function list encoded once

    The functions of a device are encoded separately from the request and the result is kept. When a request arrives, the model only has to encode the request itself.

    • 1.31 MB linear layers, 5.2 million ternary weights
    • 1.05 MB embedding of 4096 tokens, shared with the output layer
    • 0.03 MB normalisation gains

    Use in Python

    The Python package downloads the weights on first use and runs on a CPU.

    # install
    pip install git+https://github.com/Glimmer-X/TACT-tiny-function-calling-model
    import tact
    
    model = tact.load()
    device = model.bind(functions)   # the function list is encoded once
    device("turn on the kitchen light at 40 percent")
    # [{'name': 'set_light', 'arguments': {'room': 'kitchen', 'state': 'on', 'brightness': 40}}]

    TACT is built for device control with requests in English. It returns function calls and does not hold a conversation. Code and weights are under the MIT license.

    Paper

    TACT: A Weight-Shared Ternary Transformer Language Model for Function Calling in a Few Megabytes

    Dongkun Xu, Runlong Wang, Xianpo Ni, Tughrul Arslan

    BibTeX
    @misc{xu2026tact,
      title     = {TACT: A Weight-Shared Ternary Transformer Language Model for Function Calling in a Few Megabytes},
      author    = {Xu, Dongkun and Wang, Runlong and Ni, Xianpo and Arslan, Tughrul},
      year      = {2026},
      publisher = {Zenodo},
      doi       = {10.5281/zenodo.24529121}
    }