AI/EXPLORER
OutilsCatégoriesSitesLLMsComparerQuiz IAAlternativesPremium
—Outils IA
—Sites & Blogs
—LLMs & Modèles
—Catégories
AI Explorer

Trouvez et comparez les meilleurs outils d'intelligence artificielle pour vos projets.

Fait avecen France

Explorer

  • ›Tous les outils
  • ›Sites & Blogs
  • ›LLMs & Modèles
  • ›Comparer
  • ›Chatbots
  • ›Images IA
  • ›Code & Dev

Entreprise

  • ›Premium
  • ›À propos
  • ›Contact
  • ›Blog

Légal

  • ›Mentions légales
  • ›Confidentialité
  • ›CGV

© 2026 AI Explorer·Tous droits réservés.

AccueilLLMsxglm 564M

xglm 564M

par facebook

Open source · 157k downloads · 54 likes

2.2
(54 avis)ChatAPI & Local
À propos

Le modèle XGLM-564M est un modèle de langage multilingue autorégressif doté de 564 millions de paramètres, conçu pour comprendre et générer du texte dans 30 langues différentes. Entraîné sur un vaste corpus équilibré de 500 milliards de sous-tokens, il excelle dans les tâches nécessitant une compréhension contextuelle et une génération de texte cohérente, notamment dans des scénarios de few-shot learning. Ses capacités multilingues en font un outil polyvalent pour des applications comme la traduction, la réponse à des questions ou la génération de contenu dans plusieurs langues. Ce qui le distingue, c'est sa capacité à performer efficacement même avec peu d'exemples, grâce à son entraînement sur une diversité linguistique étendue. Il est particulièrement adapté aux projets nécessitant une adaptabilité linguistique sans recourir à des modèles spécialisés par langue.

Documentation

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-1familyname# tokensratioratio w/ lowRes upsampling
enIndo-EuropeanEnglish8035267361240.4899060.3259
ruIndo-EuropeanRussian1477918980980.09010790.0602
zhSino-TibetanChinese1327704946300.08094940.0483
deIndo-EuropeanGerman892237078560.05439920.0363
esIndo-EuropeanSpanish873030831050.05322820.0353
frIndo-EuropeanFrench774196397750.04720230.0313
jaJaponicJapanese660543645130.0402730.0269
itIndo-EuropeanItalian419304653380.02556480.0171
ptIndo-EuropeanPortuguese365860324440.02230630.0297
elIndo-EuropeanGreek (modern)287621661590.01753610.0233
koKoreanicKorean200022445350.01219530.0811
fiUralicFinnish168043097220.01024550.0681
idAustronesianIndonesian154235419530.009403650.0125
trTurkicTurkish124131660650.007568240.0101
arAfro-AsiaticArabic122486073450.007467910.0099
viAustroasiaticVietnamese111991218690.006828040.0091
thTai–KadaiThai108421728070.006610410.044
bgIndo-EuropeanBulgarian97037978690.005916350.0393
caIndo-EuropeanCatalan70758347750.00431410.0287
hiIndo-EuropeanHindi34483901100.002102460.014
etUralicEstonian32868738510.002003990.0133
bnIndo-EuropeanBengali, Bangla16274474500.0009922450.0066
taDravidianTamil14769733970.0009005020.006
urIndo-EuropeanUrdu13518919690.0008242410.0055
swNiger–CongoSwahili9075161390.0005533070.0037
teDravidianTelugu6893164850.0004202720.0028
euLanguage isolateBasque1053044236.42035e-050.0043
mySino-TibetanBurmese1013583316.17976e-050.003
htCreoleHaitian, Haitian Creole865846975.27902e-050.0035
quQuechuanQuechua32361081.97304e-060.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.

Python
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
Liens & Ressources
Spécifications
CatégorieChat
AccèsAPI & Local
LicenceOpen Source
TarificationOpen Source
Note
2.2

Essayer xglm 564M

Accédez directement au modèle