facebook / xglm-564M

huggingface.co
Total runs: 102.3K
24-hour runs: 0
7-day runs: 11.5K
30-day runs: 19.2K
Model's Last Updated: January 25 2023
text-generation

Introduction of xglm-564M

Model Details of xglm-564M

XGLM-564M

XGLM-564M is a multilingual autoregressive language model (with 564 million parameters) trained on a balanced corpus of a diverse set of 30 languages totaling 500 billion sub-tokens. It was introduced in the paper Few-shot Learning with Multilingual Language Models by Xi Victoria Lin*, Todor Mihaylov, Mikel Artetxe, Tianlu Wang, Shuohui Chen, Daniel Simig, Myle Ott, Naman Goyal, Shruti Bhosale, Jingfei Du, Ramakanth Pasunuru, Sam Shleifer, Punit Singh Koura, Vishrav Chaudhary, Brian O'Horo, Jeff Wang, Luke Zettlemoyer, Zornitsa Kozareva, Mona Diab, Veselin Stoyanov, Xian Li* (*Equal Contribution). The original implementation was released in this repository .

Training Data Statistics

The training data statistics of XGLM-564M is shown in the table below.

ISO-639-1 family name # tokens ratio ratio w/ lowRes upsampling
en Indo-European English 803526736124 0.489906 0.3259
ru Indo-European Russian 147791898098 0.0901079 0.0602
zh Sino-Tibetan Chinese 132770494630 0.0809494 0.0483
de Indo-European German 89223707856 0.0543992 0.0363
es Indo-European Spanish 87303083105 0.0532282 0.0353
fr Indo-European French 77419639775 0.0472023 0.0313
ja Japonic Japanese 66054364513 0.040273 0.0269
it Indo-European Italian 41930465338 0.0255648 0.0171
pt Indo-European Portuguese 36586032444 0.0223063 0.0297
el Indo-European Greek (modern) 28762166159 0.0175361 0.0233
ko Koreanic Korean 20002244535 0.0121953 0.0811
fi Uralic Finnish 16804309722 0.0102455 0.0681
id Austronesian Indonesian 15423541953 0.00940365 0.0125
tr Turkic Turkish 12413166065 0.00756824 0.0101
ar Afro-Asiatic Arabic 12248607345 0.00746791 0.0099
vi Austroasiatic Vietnamese 11199121869 0.00682804 0.0091
th Tai–Kadai Thai 10842172807 0.00661041 0.044
bg Indo-European Bulgarian 9703797869 0.00591635 0.0393
ca Indo-European Catalan 7075834775 0.0043141 0.0287
hi Indo-European Hindi 3448390110 0.00210246 0.014
et Uralic Estonian 3286873851 0.00200399 0.0133
bn Indo-European Bengali, Bangla 1627447450 0.000992245 0.0066
ta Dravidian Tamil 1476973397 0.000900502 0.006
ur Indo-European Urdu 1351891969 0.000824241 0.0055
sw Niger–Congo Swahili 907516139 0.000553307 0.0037
te Dravidian Telugu 689316485 0.000420272 0.0028
eu Language isolate Basque 105304423 6.42035e-05 0.0043
my Sino-Tibetan Burmese 101358331 6.17976e-05 0.003
ht Creole Haitian, Haitian Creole 86584697 5.27902e-05 0.0035
qu Quechuan Quechua 3236108 1.97304e-06 0.0001
Model card

For intended usage of the model, please refer to the model card released by the XGLM-564M development team.

Example (COPA)

The following snippet shows how to evaluate our models (GPT-3 style, zero-shot) on the Choice of Plausible Alternatives (COPA) task, using examples in English, Chinese and Hindi.

import torch
import torch.nn.functional as F

from transformers import XGLMTokenizer, XGLMForCausalLM

tokenizer = XGLMTokenizer.from_pretrained("facebook/xglm-564M")
model = XGLMForCausalLM.from_pretrained("facebook/xglm-564M")

data_samples = {
    'en': [
        {
            "premise": "I wanted to conserve energy.",
            "choice1": "I swept the floor in the unoccupied room.",
            "choice2": "I shut off the light in the unoccupied room.",
            "question": "effect",
            "label": "1"
        },
        {
            "premise": "The flame on the candle went out.",
            "choice1": "I blew on the wick.",
            "choice2": "I put a match to the wick.",
            "question": "cause",
            "label": "0"
        }
    ],
    'zh': [
        {
            "premise": "我想节约能源。",
            "choice1": "我在空着的房间里扫了地板。",
            "choice2": "我把空房间里的灯关了。",
            "question": "effect",
            "label": "1"
        },
        {
            "premise": "蜡烛上的火焰熄灭了。",
            "choice1": "我吹灭了灯芯。",
            "choice2": "我把一根火柴放在灯芯上。",
            "question": "cause",
            "label": "0"
        }
    ],
    'hi': [
        {
            "premise": "M te vle konsève enèji.",
            "choice1": "Mwen te fin baleye chanm lib la.",
            "choice2": "Mwen te femen limyè nan chanm lib la.",
            "question": "effect",
            "label": "1"
        },
        {
            "premise": "Flam bouji a te etenn.",
            "choice1": "Mwen te soufle bouji a.",
            "choice2": "Mwen te limen mèch bouji a.",
            "question": "cause",
            "label": "0"
        }
    ]
}

def get_logprobs(prompt):
    inputs = tokenizer(prompt, return_tensors="pt")
    input_ids, output_ids = inputs["input_ids"], inputs["input_ids"][:, 1:]
    outputs = model(**inputs, labels=input_ids)
    logits = outputs.logits
    logprobs = torch.gather(F.log_softmax(logits, dim=2), 2, output_ids.unsqueeze(2))
    return logprobs

# Zero-shot evaluation for the Choice of Plausible Alternatives (COPA) task.
# A return value of 0 indicates that the first alternative is more plausible,
# while 1 indicates that the second alternative is more plausible.
def COPA_eval(prompt, alternative1, alternative2):
    lprob1 = get_logprobs(prompt + "\n" + alternative1).sum()
    lprob2 = get_logprobs(prompt + "\n" + alternative2).sum()
    return 0 if lprob1 > lprob2 else 1

for lang in data_samples_long:
    for idx, example in enumerate(data_samples_long[lang]):
        predict = COPA_eval(example["premise"], example["choice1"], example["choice2"])
        print(f'{lang}-{idx}', predict, example['label'])
        
# en-0 1 1
# en-1 0 0
# zh-0 1 1
# zh-1 0 0
# hi-0 1 1
# hi-1 0 0

Runs of facebook xglm-564M on huggingface.co

102.3K
Total runs
0
24-hour runs
5.3K
3-day runs
11.5K
7-day runs
19.2K
30-day runs

More Information About xglm-564M huggingface.co Model

More xglm-564M license Visit here:

https://choosealicense.com/licenses/mit

xglm-564M huggingface.co

xglm-564M huggingface.co is an AI model on huggingface.co that provides xglm-564M's model effect (), which can be used instantly with this facebook xglm-564M model. huggingface.co supports a free trial of the xglm-564M model, and also provides paid use of the xglm-564M. Support call xglm-564M model through api, including Node.js, Python, http.

facebook xglm-564M online free

xglm-564M huggingface.co is an online trial and call api platform, which integrates xglm-564M's modeling effects, including api services, and provides a free online trial of xglm-564M, you can try xglm-564M online for free by clicking the link below.

facebook xglm-564M online free url in huggingface.co:

https://huggingface.co/facebook/xglm-564M

xglm-564M install

xglm-564M is an open source model from GitHub that offers a free installation service, and any user can find xglm-564M on GitHub to install. At the same time, huggingface.co provides the effect of xglm-564M install, users can directly use xglm-564M installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

xglm-564M install url in huggingface.co:

https://huggingface.co/facebook/xglm-564M

Url of xglm-564M

xglm-564M huggingface.co Url

Provider of xglm-564M huggingface.co

facebook
ORGANIZATIONS

Other API from facebook

huggingface.co

Total runs: 8.4M
Run Growth: -8.6M
Growth Rate: -102.34%
Updated:September 15 2023
huggingface.co

Total runs: 8.0M
Run Growth: 672.5K
Growth Rate: 8.42%
Updated:January 20 2022
huggingface.co

Total runs: 4.2M
Run Growth: 117.5K
Growth Rate: 2.77%
Updated:September 06 2023
huggingface.co

Total runs: 3.2M
Run Growth: 954.2K
Growth Rate: 30.05%
Updated:January 17 2024
huggingface.co

Total runs: 2.8M
Run Growth: -302.0K
Growth Rate: -10.59%
Updated:December 28 2021
huggingface.co

Total runs: 2.3M
Run Growth: 1.0M
Growth Rate: 44.69%
Updated:January 25 2024
huggingface.co

Total runs: 2.0M
Run Growth: 40.7K
Growth Rate: 2.04%
Updated:November 21 2025
huggingface.co

Total runs: 2.0M
Run Growth: 187.1K
Growth Rate: 9.46%
Updated:March 23 2023
huggingface.co

Total runs: 691.5K
Run Growth: -182.7K
Growth Rate: -26.43%
Updated:September 06 2023
huggingface.co

Total runs: 486.9K
Run Growth: -85.8K
Growth Rate: -17.63%
Updated:May 22 2023
huggingface.co

Total runs: 429.4K
Run Growth: -69.0K
Growth Rate: -16.06%
Updated:March 17 2025
huggingface.co

Total runs: 426.1K
Run Growth: 85.8K
Growth Rate: 20.14%
Updated:February 29 2024
huggingface.co

Total runs: 424.9K
Run Growth: -90.7K
Growth Rate: -21.34%
Updated:January 12 2024
huggingface.co

Total runs: 364.3K
Run Growth: -40.6K
Growth Rate: -11.13%
Updated:January 12 2024
huggingface.co

Total runs: 315.3K
Run Growth: 43.2K
Growth Rate: 13.69%
Updated:September 15 2023
huggingface.co

Total runs: 308.4K
Run Growth: 36.8K
Growth Rate: 12.02%
Updated:November 17 2022
huggingface.co

Total runs: 286.8K
Run Growth: -14.5K
Growth Rate: -5.06%
Updated:September 06 2023
huggingface.co

Total runs: 283.5K
Run Growth: 99.8K
Growth Rate: 35.58%
Updated:June 15 2023
huggingface.co

Total runs: 261.0K
Run Growth: 139.0K
Growth Rate: 53.27%
Updated:May 22 2023
huggingface.co

Total runs: 236.9K
Run Growth: 14.3K
Growth Rate: 6.02%
Updated:July 23 2024
huggingface.co

Total runs: 229.9K
Run Growth: -130.0K
Growth Rate: -56.56%
Updated:July 25 2023
huggingface.co

Total runs: 193.4K
Run Growth: 118.5K
Growth Rate: 61.25%
Updated:February 12 2023
huggingface.co

Total runs: 171.1K
Run Growth: -230.6K
Growth Rate: -134.79%
Updated:November 17 2023
huggingface.co

Total runs: 167.4K
Run Growth: 67.9K
Growth Rate: 40.58%
Updated:September 06 2023
huggingface.co

Total runs: 163.0K
Run Growth: 13.1K
Growth Rate: 8.05%
Updated:September 01 2023
huggingface.co

Total runs: 151.4K
Run Growth: 141.4K
Growth Rate: 93.35%
Updated:November 16 2023
huggingface.co

Total runs: 126.4K
Run Growth: 16.8K
Growth Rate: 12.92%
Updated:June 03 2022
huggingface.co

Total runs: 120.2K
Run Growth: 28.3K
Growth Rate: 23.53%
Updated:June 13 2023
huggingface.co

Total runs: 105.1K
Run Growth: -194.5K
Growth Rate: -185.03%
Updated:June 13 2023
huggingface.co

Total runs: 102.5K
Run Growth: -10.5K
Growth Rate: -10.20%
Updated:September 15 2023
huggingface.co

Total runs: 101.7K
Run Growth: 17.1K
Growth Rate: 16.83%
Updated:November 20 2023
huggingface.co

Total runs: 66.3K
Run Growth: 43.1K
Growth Rate: 65.10%
Updated:February 12 2023
huggingface.co

Total runs: 61.9K
Run Growth: 15.2K
Growth Rate: 24.61%
Updated:June 13 2023
huggingface.co

Total runs: 59.8K
Run Growth: 19.9K
Growth Rate: 33.25%
Updated:January 25 2023
huggingface.co

Total runs: 59.2K
Run Growth: -10.8K
Growth Rate: -18.17%
Updated:January 29 2026
huggingface.co

Total runs: 57.3K
Run Growth: -16.6K
Growth Rate: -28.94%
Updated:March 28 2026
huggingface.co

Total runs: 53.8K
Run Growth: 3.9K
Growth Rate: 7.26%
Updated:September 06 2023