# Post Quality ( PQ ) Score

To capture both the alignment quality of a data sample and its likelihood of being an outlier, we introduce a Modified Alignment Score, integrating these factors to reflect the data’s informativeness and alignment consistency. This score enhances model robustness by weighting samples that not only align with task objectives but also exhibit high novelty—offering insights into challenging or atypical instances in the data distribution. The Modified Alignment Score $$\hat{s}(\mathbf{x}, \mathbf{y})$$ is defined as follows:

$$
\hat{s}(\mathbf{x}, \mathbf{y}) =\mathbf{I}\_{ood}(\mathbf{x},\mathbf{y}) \cdot \bigg\[\frac{1}{1 + \exp(-k(s(\mathbf{x}, \mathbf{y}) - \tau))} - \frac{1}{1 + \exp(-k' (s(\mathbf{x}, \mathbf{y}) - \tau'))} \bigg] s(\mathbf{x}, \mathbf{y})
$$

<figure><img src="/files/RU7jbxhiyFuxotGnoNcy" alt="" width="563"><figcaption><p><strong>Post Quality (PQ) Score</strong> </p></figcaption></figure>

This formulation builds on previously discussed metrics for [OOD Probability](/the-network/reward-mechanism/technical-details/post-quality-memagent/outlier-likelihood.md) and [Sample Importance](/the-network/reward-mechanism/technical-details/post-quality-memagent/sample-importance.md).&#x20;

The first logistic term models the probability of a sample’s alignment score falling outside the in-distribution boundary, while the second term accounts for novelty by penalizing samples that remain within a more conservative alignment range.&#x20;

By scaling the alignment score, the Modified Alignment Score *prioritizes samples that are both semantically challenging and well-aligned with network objectives*.

## Comparison with CLIP Score

To validate the efficacy of our proposed scoring mechanism, we compare the standard CLIP Score with our Post Quality Score (PQ Score) on the CIFAR-100 dataset, using the OpenAI ResNet-50 model trained using Contrastive Language Image Pre-training ([CLIP](https://openai.com/index/clip/)) paradigm. As illustrated in the density plots, the PQ Score achieves a clearer separation between inliers and outliers, with minimal overlap between the distributions. This improved separation indicates that the PQ Score more effectively identifies challenging, novel samples while preserving alignment with network objectives.

The performance metrics further reinforce this advantage: the PQ Score consistently outperforms the standard CLIP Score across precision, recall, F1 score, and accuracy. These gains highlight the PQ Score’s ability to prioritize samples that are both semantically challenging and well-aligned with task goals, enhancing the model’s robustness in detecting out-of-distribution instances. By capturing both alignment quality and novelty, our scoring mechanism offers a more nuanced approach to sample selection, ideal for tasks requiring reliable detection of novel but relevant data points.

<div align="left"><figure><img src="/files/O2JocGc2YNPGG8hoWnA7" alt="" width="375"><figcaption><p>CLIP Score (CIFAR 100)</p></figcaption></figure> <figure><img src="/files/niSRk4DZ3Uobvr2An3vZ" alt="" width="375"><figcaption><p>(Ours) PQ Score (CIFAR 100)</p></figcaption></figure></div>

| Metric     | Precision | Recall    | F1 Score  | Accuracy  |
| ---------- | --------- | --------- | --------- | --------- |
| CLIP Score | **99.94** | 95.71     | 97.78     | 95.70     |
| PQ Score   | **99.93** | **96.71** | **98.30** | **96.67** |

<div><figure><img src="/files/nGGB5EAG918IQEDAUWQW" alt=""><figcaption><p>CLIP Score</p></figcaption></figure> <figure><img src="/files/iwKKpgk2KWIC8JOciHQf" alt=""><figcaption><p>(Ours) PQ Score</p></figcaption></figure></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eidon.ai/the-network/reward-mechanism/technical-details/post-quality-memagent/post-quality-pq-score.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
