transformers pytorch safetensors electra token-classification en license:cc-by-nc-sa-4.0 autotrain_compatible endpoints_compatible region:us
---
language:
- en
license: cc-by-nc-sa-4.0
---

--------------------------------------------------------------------------------------------------

<body>
<span class="vertical-text" style="background-color:lightgreen;border-radius: 3px;padding: 3px;"> </span>
<br>
<span class="vertical-text" style="background-color:orange;border-radius: 3px;padding: 3px;">  </span>
<br>
<span class="vertical-text" style="background-color:lightblue;border-radius: 3px;padding: 3px;">    Model: CORTEX-334M</span>
<br>
<span class="vertical-text" style="background-color:tomato;border-radius: 3px;padding: 3px;">    Lang: EN</span>
<br>
<span class="vertical-text" style="background-color:lightgrey;border-radius: 3px;padding: 3px;">  </span>
<br>
<span class="vertical-text" style="background-color:#CF9FFF;border-radius: 3px;padding: 3px;"> </span>
</body>

### [ PROTOTYPE ]

--------------------------------------------------------------------------------------------------

### Model description

<b>Description:</b> Instruction-based encoder-only LLM, designed for multi-task and zero-shot inference in discriminative scenarios

<b>Base model:</b> Electra-Large

<b>Number of parameters:</b> 334M

<b>License:</b> CC-BY-NC-SA (no commercial usage is allowed)

<b>Warning ⚠️:</b> This is an early-stage prototype, which can exhibit unstable behaviors and results. The access is currently limited to selected users for testing purposes

--------------------------------------------------------------------------------------------------

### Technology overview

The main idea of the <b>CORTEX</b> technology is to create an effective, easy-to-use and easy-to-train prompt-based LLM with encoder-only architecture, capable of tackling several different <b>discriminative tasks</b> with good zero-shot capabilities.

The model leverages a <b>unified task format</b> based on a token-classification setup, and therefore a single loss-function to optimize.

Compared to prompt-based generative LLMs, the CORTEX technology doesn't suffer from hallucinations and is more compact and efficient, since it doesn't need to generate text, which requires lots of extra parameters and several inference steps to produce an output.

Moreover, it can provide confidence scores for its predictions and deliver results in structured format without any kind of output parsing.

The CORTEX-334M prototype can be prompted to perform the following tasks

- Text Classification
- Natural Language Inference
- Entity Recognition
- Boolean Question Answering
- Extractive Question Answering
- Text Similarity
- Ranking / Retrieval
- Sentiment Analysis

--------------------------------------------------------------------------------------------------

### Training strategy

The model has been obtained using Electra-Large as a starting point, and trained for 1 epoch with a constant learning rate of 1e-5, on ~300.000 triplets (question, context, answer) sampled from benchmark datasets for <b>classic discriminative tasks</b>, like Natural Language inference, Named Entity Recognition, Boolean Question Answering, Extractive Question Answering, Sentiment Analysis.
In particular, the MNLI, WikiNER, BoolQ, SQuAD v1 and MTEB Tweets datasets have been used as sources of examples.

The different tasks have all been casted into a unified <b>token-classification setup</b>, so the model has been trained on the different objectives using a single classification head and loss function, avoiding the complications related to the combination of different task-specific classifiers and losses (like the introduction of loss-weighting, gradient modulation or task scheduling).

Using this framework, each token can be classified into <b>3 possible categories</b> (0: neutral, 1: positive, 2: negative), with some constraints depending on the nature of the token (e.g. whether it's a [CLS] token, prompt token or context token)

The <b>categorical cross-entropy</b> loss has been used for all the training examples, with two different computation methods: in text classification tasks (Natural Language Inference, Boolean Question Answering or Sentiment Analysis) only the [CLS] token contributes to the loss, while in information extraction tasks (Named Entity Recognition, Extractive Question Answering) the loss is computed considering all tokens.

--------------------------------------------------------------------------------------------------

### Limitations

This LLM is an early-stage technology and may exhibit unstable or unreliable behaviours. The prototype is only meant for experimentation and research and its results should be used with caution.