# Friendly Neighbors:
Contextualized Sequence-to-Sequence Link Prediction

Adrian Kochsiek
University of Mannheim
Germany
akochsiek
@uni-mannheim.de
&Apoorv Saxena
Adobe Research
India
apoorvs
@adobe.com
&Inderjeet Nair
Adobe Research
India
inderjeetnair1
@gmail.com
&Rainer Gemulla
University of Mannheim
Germany
rgemulla
@uni-mannheim.de

###### Abstract

We propose _KGT5-context_ , a simple sequence-to-sequence model for link
prediction (LP) in knowledge graphs (KG). Our work expands on KGT5, a recent
LP model that exploits textual features of the KG, has small model size, and
is scalable. To reach good predictive performance, however, KGT5 relies on an
ensemble with a knowledge graph embedding model, which itself is excessively
large and costly to use. In this short paper, we show empirically that adding
contextual information—i.e., information about the direct neighborhood of the
query entity—alleviates the need for a separate KGE model to obtain good
performance. The resulting KGT5-context model is simple, reduces model size
significantly, and obtains state-of-the-art performance in our experimental
study.

##  1 Introduction

Figure 1: Overview of KGT5-context (at bottom) and comparison to KGT5 (on
top); real example from Wikidata5M, best viewed in color. KGT5-context differs
from KGT5 in that it appends the neighboring relations and entities of
_Yambaó_ (a drama movie) to the verbalized query. Both models then apply T5,
sample predictions from the decoder, map the samples to entities, and rank by
sample logit scores.

A knowledge graph (KG) is a collection of facts describing relations between
real-world entities. Facts are represented in the form of subject-relation-
object ($(s,r,o)$) triples such as (_Brendan Fraser, hasWonPrize, Oscar_). In
this paper, we study the link prediction (LP) problem, which is to infer
missing links in the KG. We focus on KGs in which the entities and relations
have textual features, such as mention names or descriptions.

Saxena et al. (2022) made a case for large language models (LM) for this task.
They proposed the KGT5 model, which posed the link prediction problem as a
sequence-to-sequence (seq2seq) task. The main advantages of this approach are
that

  1. (i)

it allows for small model sizes, and

  2. (ii)

it decouples inference cost from the graph size (and, in particular, the
number of entities).

They found that KGT5’s performance was particularly strong when predicting the
object of new relations for a query entity (e.g., the birthplace of a person),
but fell short of alternative approaches when predicting additional objects
for a known relation (e.g., additional awards won by someone).

To avoid this problem, Saxena et al. (2022) used an ensemble of KGT5 with a
large knowledge graph embedding (KGE) model (ComplEx Trouillon et al. (2016)).
This ensemble did reach good performance but destroyed both advantages (i) and
(ii) of using a LM. In fact, KGE models learn a low-dimensional representation
of each entity and each relation in the graph Bordes et al. (2013); Sun et al.
(2019); Trouillon et al. (2016). Consequently, model size and LP cost are
linear in the number of entities in the graph, which can be expensive to use
for large-scale KGs. For example, the currently best-performing model Cattaneo
et al. (2022) for the large-scale WikiKG90Mv2 benchmark Hu et al. (2021)
consists of an ensemble of $85$ KGE models; each taking up more than 86GB of
space for parameters. Though KGE model sizes can be reduced by using
compositional embeddings based on text mentions Wang et al. (2021); Clouatre
et al. (2021); Wang et al. (2022); Jiang et al. (2023), inference cost remains
high for large graphs.

We propose and study KGT5-context, which expands on KGT5 by providing
contextual information about the query entity—i.e., information about the
direct neighborhood of the query entity—to facilitate link prediction. Our
work is motivated by the KGE model HittER Chen et al. (2021), which follows a
similar approach; we use the seq2seq model KGT5 instead of a Transformer-based
KGE model. KGT5-context is very simple: The only change to KGT5 is that we add
a verbalization of the neighborhood of the query entity to the description of
a given LP task; see Fig. 1 for an example. KGT5-context retains advantages
(i) and (ii) of KGT5.

We performed an experimental study using the Wikidata5M Wang et al. (2021) and
WikiKG90Mv2 Hu et al. (2021) benchmarks. We found that—without further
hyperparameter tuning—KGT5-context reached or exceeded state-of-the-art
performance on both benchmarks using a significantly smaller model size than
alternative approaches. The simple KGT5-context model thus provides a suitable
baseline for further research.

##  2 Expanding KGT5 with Context

Given a _query_ $(s,r,?)$ and a KG, LP is the task to predict new answer
entities, i.e., the $?$ slot of the query. An example is given in Fig. 1.

KGT5 Saxena et al. (2022) treats link prediction as a seq2seq task. It exploits available textual information for entities and relations, such as mention names (for both entities and relations) or descriptions. KGT5’s architecture is based on the encoder-decoder Transformer model T5 Raffel et al. (2020). It uses canonical mentions to verbalize the LP query to a text sequence of form “predict tail: <subject mention> | <relation mention> | ”. To predict answers, KGT5 samples (exact) candidate mentions from the decoder; the cost of sampling is independent of the number of entities in the KG. To train KGT5, Saxena et al. (2022) use standard training techniques for LLMs: KGT5 is trained on facts in the KG and asked to generate the true answer using teacher forcing and a cross-entropy loss.

KGT5-context (ours) proceeds in the same way as KGT5 but extends the
verbalization of the query. In particular, we append a textual sequence of the
one-hop neighborhood of the query entity $s$ to the verbalized query of KGT5.
As a result, the query entity is contextualized, an approach that has been
applied successfully to KGE models before Chen et al. (2021). KGT5-context
simplifies the prediction problem because additional information that is
readily available in the KG is provided along with the query. In the example
of Fig. 1, the contextual information states that _Yambaó_ is a Mexican movie.
This information is helpful; e.g., it already rules out the top two
predictions of KGT5, which incorrectly suggest that _Yambaó_ is a piece of
music. For a more detailed analysis, see Sec. 3.3.

Verbalization details. To summarize, we obtain mentions of the entities and relations in the query as well as in the one-hop neighborhood of the query entity. We use these mentions to verbalize the query together with the neighborhood as “query: <query entity mention> | <query relation mention> | context: <context relation 1 mention> | <context entity 1 mention> <SEP> …”.111When entity descriptions are available, we include “description: <description of query entity>” right before the query context. To keep direction of relations, we prepend the relation mention with “reverse of” if the query entity acts as an object, i.e., the relation “points towards” the query entity. A real-world example is given in Fig. 1. Inspired by neighborhood sampling in GNNs Hamilton et al. (2017), we sample up to $k$ (default: $k=100$) relation-neighbor pairs uniformly, at random, and without replacement.

##  3 Experimental Study

We conducted an experimental study to investigate (i) to what extent
integrating context in terms of the entity neighborhood into KGT5 improves
link prediction performance, (ii) whether the use of context can mitigate the
necessity for an ensemble of the text-based KGT5 model with a KGE model, and
(iii) for what kind of queries context is helpful. We found that:

  1. 1.

KGT5-context improved the state-of-the-art performance on Wikidata5M using a
smaller model (Tab. 2).

  2. 2.

KGT5-context was orders of magnitudes smaller than the leading models on
WikiKG90Mv2 and reached competitive performance (Tab. 3).

  3. 3.

KGT5-context did not benefit further from ensembling with a KGE model (Tab.
4).

Dataset | Entities | Relations | Edges
---|---|---|---
Wikidata5M | 4.8M | 828 | 21M
WikiKG90Mv2 | 91M | 1,387 | 601M
Table 1:  Dataset statistics.

|  |  |  |  |  |  Add. requirements for inference |  Pre- trained
---|---|---|---|---|---|---|---
Model | MRR | Hits@1 | Hits@3 | Hits@10 | Params
SimplE † | 0.296 | 0.252 | 0.317 | 0.377 | 2,400M | - | no
ComplEx †† | 0.308 | 0.255 | - | 0.398 | 614M | - | no
SimKGC | 0.212 | 0.182 | 0.223 | 0.266 | 220M | entity embeddings | yes
KGT5 ‡ | 0.300 | 0.267 | 0.318 | 0.365 | 60M | - | no
\+ ComplEx ‡ | 0.336 | 0.286 | 0.362 | 0.426 | 674M | - | no
KGT5-context (ours) | 0.378 | 0.350 | 0.396 | 0.427 | 60M | 1-hop neighborhood | no
SimKGC + Desc. ‡‡ | 0.358 | 0.313 | 0.376 | 0.441 | 220M | entity embeddings | yes
\+ Hard Negative Ensemble $ | 0.420 | 0.381 | 0.435 | 0.490 | 1,100M | entity embeddings | yes
KGT5 + Desc. | 0.381 | 0.357 | 0.397 | 0.422 | 60M | - | no
KGT5-context + Desc. (ours) | 0.426 | 0.406 | 0.440 | 0.460 | 60M | 1-hop neighborhood | no

Table 2:  Link prediction results on Wikidata5M, test split. The first group
does not make use of textual information, the second group uses mention names,
the third group additionally entity descriptions. Best per group underlined,
best overall bold. Marked results are from $\dagger$ Zhu et al. (2019),
$\dagger\dagger$ Kochsiek and Gemulla (2021), $\ddagger$ Saxena et al. (2022),
$\ddagger\ddagger$ Wang et al. (2022), $\$$ Jiang et al. (2023). Additional
results in Tab. 5 (appendix).

###  3.1 Experimental Setup

Source code and configuration are available at https://github.com/uma-
pi1/kgt5-context.

Datasets. We evaluate KGT5-context on two commonly used large-scale link
prediction benchmarks. Wikidata5M Wang et al. (2021) is the induced graph of
the 5M most-frequent entities of the Wikidata KG. WikiKG90Mv2 Hu et al. (2021)
contains more than 90M entities and over 600M facts. In contrast to
Wikidata5M, it is only evaluated on tail prediction, i.e., $(s,r,?)$ queries.
Dataset statistics are summarized in Tab. 1. For Wikidata5M and
WikiKG90Mv2222We directly used mentions of entities and relations for
WikiKG90Mv2, instead of the textual embeddings used by other models. For this
reason, the benchmark authors Hu et al. (2021) did not provide us with scores
on the hidden test set. The mentions used to be provided with the dataset but
have been removed by now; we obtained them from
https://github.com/apoorvumang/kgt5., we used the entity mentions provided on
the KGT5 webpage. For Wikidata5M, we also consider the usefulness of entity
descriptions, which are provided with the dataset and have been used in some
prior studies Wang et al. (2022); Jiang et al. (2023). Note that we do not use
these descriptions by default, and clearly mark throughout when they have been
used.

Metrics. We follow the standard procedure to evaluate model quality for the
link prediction task. In particular, for each test triple $(s,r,o)$, we rank
all triples of the form $(s,r,?)$ (and $(?,r,o)$ on Wikidata5M) by their
predicted scores. For KGT5 and KGT5-context, we instead sample from the
decoder and ignore outputs that do not correspond to an existing entity
mention. For all models, we filter out all true answers other than the test
triple that occur either in the train, valid or test data. Finally, we
determine the mean reciprocal rank (MRR) and Hits@K over all test triples. In
case of ties, we use the mean rank to avoid misleading results Sun et al.
(2020).

Settings. We mainly follow the setting of KGT5. For all experiments, we used
the same T5 architecture (T5-small for Wikidata5M, T5-base for WikiKG90Mv2)
without any pretrained weights. Training from scratch ensures test data is
unseen during (pre-)training and avoids leakage. We used the SentencePiece
tokenizer pretrained by Raffel et al. (2020). We trained on 8 A100-GPUs with a
batch size of $32$ (effective batch size of $256$) using the AdaFactor
optimizer. No dataset-specific hyperparameter optimization was performed. For
KGT5-context, we sampled up to $100$ neighbors per query entity or up to an
input sequence length of 512 tokens. For inference, we obtained $500$ samples
from the decoder.

Models. On Wikidata5M, we compare KGT5-context to the KGE models ComplEx
Trouillon et al. (2016) and SimplE Kazemi and Poole (2018) (only graph
structure used), the compositional KGE model SimKGC Wang et al. (2022), its
extension utilizing hard negatives Jiang et al. (2023), and the seq2seq model
KGT5 Saxena et al. (2022). The model of Jiang et al. (2023) is an ensemble of
multiple SimKGC models, each trained with a different strategy for selecting
negatives. Note that in contrast to KGT5 and KGT5-context, SimKGC is based on
pretrained models (BERT transformers). During prediction, all text-based
models require access to entity and relation mentions and, when used, the
description of the query entity. SimKGC additionally requires access to
precomputed entity embeddings, KGT5-context to the 1-hop neighborhood of the
query entity in the KG.

On WikiKG90M, we compare to the models presented on the official leaderboard.2
Here, the best-performing approaches are large ensembles of multiple KGE
models.

###  3.2 Link Prediction Performance

Link prediction performance on Wikidata5M is shown in Tab. 2; additional
baselines are given in Tab. 5 (appendix). Generally, we found that textual
information was highly beneficial. KGT5-context was the only model that
improved upon KGE models (which do not use textual information) when only
mention information was available. Moreover, KGT5-context obtained better
predictive performance than the ensemble of KGT5 with the ComplEx KGE model.
Entity descriptions provided further improvements; they hold valuable
information for this benchmark. With these descriptions, KGT5-context
outperformed traditional KGE models by up to 12pp in terms of MRR, with a
model size reduction of 90-98%. Likewise, KGT5-context improved on KGT5 by
12pp, on the KGT5+Complex ensemble by almost 9pp, and performed roughly on-par
with the current state-of-the-art SimKGC ensemble model, which is
significantly larger.

The results on the much larger WikiKG90Mv2 are shown in Tab. 3.2 Here,
KGT5-context is multiple orders of magnitude smaller than the currently best-
performing models,333The parameter count in Tab. 3 corresponds to the size of
the largest model in an ensemble, not the overall model size. For example,
BESS Cattaneo et al. (2022) consists of 85 models and the complete ensemble
has 2.6T parameters; the KGT5-context model is 5 orders of magnitude smaller.
and improves validation MRR by almost 1pp.

Model |  | Test
---
MRR
| Valid
---
MRR
Params
ComplEx | 0.141 | 0.182 | 18.2B
TransE | 0.082 | 0.110 | 18.2B
ComplEx-Concat | 0.176 | 0.205 | 18.2B
TransE-Concat | 0.176 | 0.206 | 18.2B
PIE-RM | 0.212 | 0.254 | 18.2B3
DGLKE + Rule Mining | 0.249 | 0.292 | 18.2B3
BESS | 0.254 | 0.292 | 23.3B3
KGT5, T5 small2 | - | 0.221 | 60M
KGT5-context, T5 base (ours)2 | - | 0.301 | 220M

Table 3:  Link prediction results on WikiKG90Mv2. Baseline numbers are from
the official leaderboard of OGB-LSC Hu et al. (2021).

###  3.3 Analysis

Model | 0 | 1-10 | >10 | All
---|---|---|---|---
ComplEx | 0.534 | 0.351 | 0.045 | 0.296
KGT5 | 0.624 | 0.215 | 0.015 | 0.300
KGT5-context (ours) | 0.738 | 0.415 | 0.014 | 0.378
KGT5 + ComplEx | 0.624 | 0.351 | 0.045 | 0.336
KGT5-context + ComplEx | 0.738 | 0.351 | 0.045 | 0.379

Table 4: Test MRR on Wikidata5M grouped by query frequency during training.

To investigate in which cases context information was beneficial, we
empirically analyzed LP performance w.r.t. (i) query frequency and (ii) the
degree of the query entity. We also sampled predictions and summarize our
general observations.

Query frequency. The _frequency_ of a test query $(s,r,?)$ is the number of
answers to the query already available in the training data. For example,
queries for N:1 relations have frequency 0, whereas queries for 1:N relations
can have large frequency for high-degree query entities. We bucketized the
test queries of Wikidata5M into low, medium, and high frequency queries and
report average MRR for various models in Tab. 4. Generally, high-frequency
queries appear harder to answer. These queries have many known true answers
already (tying up model capacity); there may be many additional, potentially
unrelated answers and incompleteness of the KG may be a concern during
evaluation. In contrast, a low-frequency query such as _(Brendan Fraser,
instance Of, ?)_ has few or no known answer and might be easier to infer, even
when the combination of this particular subject and relation was not yet seen
during training.

Ensemble with KGE models. In general, the prior KGT5 model performed
reasonably well on queries that did not occur in the training data, but was
outperformed by a large amount by ComplEx on queries seen multiple times.
Hence, both models complemented each other in an ensemble. KGT5-context
strongly improved performance over ComplEx, KGT5, and the KGT5+Complex
ensemble for low- and medium-frequency queries. For this reason, an ensemble
between KGT5-context and ComplEx only brought negligible benefits, but has
substantial drawbacks. Consequently, an ensemble of KGT5-context with a KGE
model is not needed and should not be used.

Entity degree. We also investigated the benefit of contextual information
w.r.t. to the degree of the query entity (see Fig. 2 in the appendix). We
found that KGT5-context was beneficial and performed well on query entities
with a degree of up to 100. For entities with very large degrees (i.e., nodes
with more than 100 or even 1000s of neighbors), ComplEx showed benefits. As
before, we feel that these performance benefits are negligible considering the
increase in model size and decrease in scalability.

Anecdotal results. We manually probed some predictions of KGT5-context and
found the context is especially beneficial when (i) the entity mention only
provides limited information about the entity, and/or when (ii) the answer to
the query is contained in the one-hop neighborhood.

A case of (i) is shown in Fig. 1, a real example. Here, KGT5 was able to
capture the geographic region of the real-world entity only based on its
mention. Based on this geographic notion, it proposed the music genre _Latin
pop_ but was unaware that the entity is a movie. This useful information can
be obtained directly from the one-hop neighborhood and, indeed, was exploited
by KGT5-context.

For Wikidata5M, the correct answer entity appears in the one-hop neighborhood
of the query entity for about $7\%$ of the validation triples. But even when
the answer does not directly appear in the context, it may contain entities
strongly hinting at the correct answer. For example, it is easier to predict
that an entity has occupation _biochemist_ , when the context already contains
the information that the entity is a _chemist_.

##  4 Conclusion

We proposed and studied KGT5-context, a sequence-to-sequence model for link
prediction in knowledge graphs. KGT5-context extends the KGT5 model of Saxena
et al. (2022) by using contextual information of the query entity for
prediction. KGT5-context is simple, small, and scalable, and it obtained or
exceeded state-of-the-art performance in our experimental study. It thus
provides a suitable baseline for further research in this area. A natural
direction, for example, is to explore approaches that integrate contextual
information in a less naive way than KGT5-context does.

## Limitations

KGT5-context relies on the textual mentions of entities and relations (and,
optionally, entity descriptions). Therefore, it is only applicable to KGs that
provide such information. KGT5-context may be able to handle some entities
without textual features when well-described by their neighborhood; we did not
investigate this though.

To use KGT5-context for prediction, the KG has to be queried to obtain context
information, i.e., the one-hop neighborhood of the query entity. KGT5-context
thus cannot be used without the underlying KG.

The verbalized neighborhood of the query entity leads to long input sequences,
which in turn may induce higher memory consumption and higher computational
cost during training. Overall, training KGT5-context is typically more
expensive than training traditional KGE models, which can be tuned Kochsiek et
al. (2022) and trained efficiently Lerer et al. (2019); Kochsiek and Gemulla
(2021); Zheng et al. (2020).

For inference, KGT5-context first samples relation-neighbor pairs for
contextualization, and then samples possible answers from the decoder. These
sampling steps can lead to variance in predictive performance. We found this
effect to be negligible on Wikidata5M, but it may be larger on other datasets.

## Ethics Statement

This research uses publicly available data and benchmarks for evaluation. We
believe that this research was conducted in an ethical manner and in
compliance with all relevant laws and regulations.

## References

  * Bordes et al. (2013) Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. 2013.  Translating embeddings for modeling multi-relational data.  In _Neural Information Processing Systems (NIPS)_ , pages 1–9.
  * Cattaneo et al. (2022) Alberto Cattaneo, Daniel Justus, Harry Mellor, Douglas Orr, Jerome Maloberti, Zhenying Liu, Thorin Farnsworth, Andrew Fitzgibbon, Blazej Banaszewski, and Carlo Luschi. 2022.  Bess: Balanced entity sampling and sharing for large-scale knowledge graph completion.  _arXiv preprint arXiv:2211.12281_.
  * Chen et al. (2021) Sanxing Chen, Xiaodong Liu, Jianfeng Gao, Jian Jiao, Ruofei Zhang, and Yangfeng Ji. 2021.  Hitter: Hierarchical transformers for knowledge graph embeddings.  In _Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing_ , pages 10395–10407.
  * Clouatre et al. (2021) Louis Clouatre, Philippe Trempe, Amal Zouaq, and Sarath Chandar. 2021.  Mlmlm: Link prediction with mean likelihood masked language model.  In _Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021_ , pages 4321–4331.
  * Hamilton et al. (2017) William L. Hamilton, Rex Ying, and Jure Leskovec. 2017.  Inductive representation learning on large graphs.  In _Proceedings of the 31st International Conference on Neural Information Processing Systems_ , NIPS’17, pages 1025–1035, Red Hook, NY, USA. Curran Associates Inc.
  * Hu et al. (2021) Weihua Hu, Matthias Fey, Hongyu Ren, Maho Nakata, Yuxiao Dong, and Jure Leskovec. 2021.  Ogb-lsc: A large-scale challenge for machine learning on graphs.  _Advances in Neural Information Processing Systems_ , 35.
  * Jiang et al. (2023) Fan Jiang, Tom Drummond, and Trevor Cohn. 2023.  Don’t mess with mister-in-between: Improved negative search for knowledge graph completion.  In _Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics_ , pages 1810–1824.
  * Kazemi and Poole (2018) Seyed Mehran Kazemi and David Poole. 2018.  Simple embedding for link prediction in knowledge graphs.  In _Advances in Neural Information Processing Systems_.
  * Kochsiek and Gemulla (2021) Adrian Kochsiek and Rainer Gemulla. 2021.  Parallel training of knowledge graph embedding models: a comparison of techniques.  _Proceedings of the VLDB Endowment_ , 15(3):633–645.
  * Kochsiek et al. (2022) Adrian Kochsiek, Fritz Niesel, and Rainer Gemulla. 2022.  Start small, think big: On hyperparameter optimization for large-scale knowledge graph embeddings.  In _Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2022, Grenoble, France, September 19–23, 2022, Proceedings, Part II_ , pages 138–154. Springer.
  * Lerer et al. (2019) Adam Lerer, Ledell Wu, Jiajun Shen, Timothee Lacroix, Luca Wehrstedt, Abhijit Bose, and Alex Peysakhovich. 2019.  Pytorch-biggraph: A large scale graph embedding system.  _Proceedings of Machine Learning and Systems_ , 1:120–131.
  * Raffel et al. (2020) Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020.  Exploring the limits of transfer learning with a unified text-to-text transformer.  _Journal of Machine Learning Research_ , 21(140):1–67.
  * Saxena et al. (2022) Apoorv Saxena, Adrian Kochsiek, and Rainer Gemulla. 2022.  Sequence-to-sequence knowledge graph completion and question answering.  In _Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_ , pages 2814–2828.
  * Sun et al. (2019) Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, and Jian Tang. 2019.  Rotate: Knowledge graph embedding by relational rotation in complex space.  In _International Conference on Learning Representations_.
  * Sun et al. (2020) Zhiqing Sun, Shikhar Vashishth, Soumya Sanyal, Partha Talukdar, and Yiming Yang. 2020.  A re-evaluation of knowledge graph completion methods.  In _Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics_ , pages 5516–5522.
  * Trouillon et al. (2016) Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. 2016.  Complex embeddings for simple link prediction.  In _International conference on machine learning_ , pages 2071–2080. PMLR.
  * Wang et al. (2022) Liang Wang, Wei Zhao, Zhuoyu Wei, and Jingming Liu. 2022.  Simkgc: Simple contrastive knowledge graph completion with pre-trained language models.  In _Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_ , pages 4281–4294.
  * Wang et al. (2021) Xiaozhi Wang, Tianyu Gao, Zhaocheng Zhu, Zhengyan Zhang, Zhiyuan Liu, Juanzi Li, and Jian Tang. 2021.  Kepler: A unified model for knowledge embedding and pre-trained language representation.  _Transactions of the Association for Computational Linguistics_ , 9:176–194.
  * Xie et al. (2016) Ruobing Xie, Zhiyuan Liu, Jia Jia, Huanbo Luan, and Maosong Sun. 2016.  Representation learning of knowledge graphs with entity descriptions.  _Proceedings of the AAAI Conference on Artificial Intelligence_ , 30(1).
  * Yang et al. (2015) Bishan Yang, Scott Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. 2015.  Embedding entities and relations for learning and inference in knowledge bases.  In _Proceedings of the International Conference on Learning Representations (ICLR) 2015_.
  * Zheng et al. (2020) Da Zheng, Xiang Song, Chao Ma, Zeyuan Tan, Zihao Ye, Jin Dong, Hao Xiong, Zheng Zhang, and George Karypis. 2020.  Dgl-ke: Training knowledge graph embeddings at scale.  In _Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval_ , pages 739–748.
  * Zhu et al. (2019) Zhaocheng Zhu, Shizhen Xu, Meng Qu, and Jian Tang. 2019.  Graphvite: A high-performance cpu-gpu hybrid system for node embedding.  In _The World Wide Web Conference_ , pages 2494–2504. ACM.

## Appendix

Figure 2: MRR grouped by entity degree on Wikidata5M. Group weight is given in brackets. Model | MRR | Hits@1 | Hits@3 | Hits@10 | Params
---|---|---|---|---|---
TransE Bordes et al. (2013) † | 0.253 | 0.170 | 0.311 | 0.392 | 2,400M
DistMult Yang et al. (2015) † | 0.253 | 0.209 | 0.278 | 0.334 | 2,400M
RotatE Sun et al. (2019) † | 0.290 | 0.234 | 0.322 | 0.390 | 2,400M
DKRL Xie et al. (2016) $ | 0.160 | 0.120 | 0.181 | 0.229 | 20M
KEPLER Wang et al. (2021) $ | 0.210 | 0.173 | 0.224 | 0.277 | 125M
MLMLM Clouatre et al. (2021) †† | 0.223 | 0.201 | 0.232 | 0.264 | 355M
Table 5:  Additional link prediction results on Wikidata5M from prior work.
Results are from $\dagger$ Zhu et al. (2019). $\$$ Wang et al. (2021).
$\dagger\dagger$ Clouatre et al. (2021).


# Crystal Structure Prediction and Phase Stability in Highly Anharmonic
Silver-Based Chalcohalide Anti-Perovskites

Pol Benítez  Group of Characterization of Materials, Departament de Física,
Universitat Politècnica de Catalunya, Campus Diagonal-Besòs, Av. Eduard
Maristany 10–14, 08019 Barcelona, Spain  Research Center in Multiscale Science
and Engineering, Universitat Politècnica de Catalunya, Campus Diagonal-Besòs,
Av. Eduard Maristany 10–14, 08019 Barcelona, Spain  Cibrán López  Group of
Characterization of Materials, Departament de Física, Universitat Politècnica
de Catalunya, Campus Diagonal-Besòs, Av. Eduard Maristany 10–14, 08019
Barcelona, Spain  Research Center in Multiscale Science and Engineering,
Universitat Politècnica de Catalunya, Campus Diagonal-Besòs, Av. Eduard
Maristany 10–14, 08019 Barcelona, Spain  Cong Liu  Departament de Física,
Universitat Politècnica de Catalunya, Campus Nord, Jordi Girona 1–3, 08005
Barcelona, Spain  Ivan Caño  Research Center in Multiscale Science and
Engineering, Universitat Politècnica de Catalunya, Campus Diagonal-Besòs, Av.
Eduard Maristany 10–14, 08019 Barcelona, Spain  Department of Electronic
Engineering, Universitat Politècnica de Catalunya, 08034 Barcelona, Spain
Josep-Lluís Tamarit  Group of Characterization of Materials, Departament de
Física, Universitat Politècnica de Catalunya, Campus Diagonal-Besòs, Av.
Eduard Maristany 10–14, 08019 Barcelona, Spain  Research Center in Multiscale
Science and Engineering, Universitat Politècnica de Catalunya, Campus
Diagonal-Besòs, Av. Eduard Maristany 10–14, 08019 Barcelona, Spain  Edgardo
Saucedo  Research Center in Multiscale Science and Engineering, Universitat
Politècnica de Catalunya, Campus Diagonal-Besòs, Av. Eduard Maristany 10–14,
08019 Barcelona, Spain  Department of Electronic Engineering, Universitat
Politècnica de Catalunya, 08034 Barcelona, Spain  Claudio Cazorla  Group of
Characterization of Materials, Departament de Física, Universitat Politècnica
de Catalunya, Campus Diagonal-Besòs, Av. Eduard Maristany 10–14, 08019
Barcelona, Spain  Research Center in Multiscale Science and Engineering,
Universitat Politècnica de Catalunya, Campus Diagonal-Besòs, Av. Eduard
Maristany 10–14, 08019 Barcelona, Spain

###### Abstract

Silver-based chalcohalide anti-perovskites (CAP), Ag3BC (B = S, Se; C = Cl,
Br, I), represent an emerging family of energy materials with intriguing
optoelectronic, vibrational and ionic transport properties. However, the
structural features and phase stability of CAP remain poorly investigated to
date, hindering their fundamental understanding and potential integration into
technological applications. Here we employ theoretical first-principles
methods based on density functional theory to fill this knowledge gap. Through
crystal structure prediction techniques, ab initio molecular dynamics
simulations, and quasi-harmonic free energy calculations, we unveil a series
of previously overlooked energetically competitive phases and temperature-
induced phase transitions for all CAP. Specifically, we identify a new cubic
$P2_{1}3$ structure as the stable phase of all CAP containing S both at zero
temperature and $T\neq 0$ K conditions. Consequently, our calculations suggest
that the cubic $Pm\overline{3}m$ phase identified in room-temperature X-ray
diffraction experiments is likely to be metastable. Furthermore, for CAP
containing Se, we propose different orthorhombic ($Pca2_{1}$ and
$P2_{1}2_{1}2_{1}$) and cubic ($I2_{1}3$) structures as the ground-state
phases and reveal several phase transformations induced by temperature. This
theoretical investigation not only identifies new candidate ground-state
phases and solid-solid phase transformations for all CAP but also provides
insights into potential stability issues affecting these highly anharmonic
superionic materials.

##  I Introduction

Silver-based chalcohalide anti-perovskites (CAP) with chemical formula Ag3BC
(B = S, Se; C = Cl, Br, I) are structurally similar to the lead halide
perovskites (e.g., CsPbI3), with the “anti” designation indicating the
exchange of anions and cations compared to the typical ionic perovskite
arrangement. Analogous to lead halide perovksites, CAP are highly promising
materials for energy and optoelectronic applications, boasting low toxicity
due to their lead-free composition palazon22 ; ghorpade23 . The two most
extensively studied CAP compounds, Ag3SBr and Ag3SI, possess experimentally
determined band gaps of approximately $1.0$ eV luna23 ; cano24 , rendering
them favorable for photovoltaic applications. These have been also recognized
as room-temperature superionic conductors takahashi66 ; hull04 . Owing to
their substantial vibrational anharmonicity and intriguing transport
properties wakamura90 ; sakuma85 , CAP have been also investigated as
potential thermoelectric materials kawamura80 ; magistris72 .

The current surge in interest in CAP is evident from the recent publication of
several experimental works detailing improved synthesis methods. The
pioneering synthesis of the archetypal CAP Ag3SI and Ag3SBr dates back to
$1960$, credited to Reuter and Hardel reuter60 . However, the majority of
early CAP synthesis techniques required vacuum conditions, elevated
temperatures ($>600$ K), and prolonged synthesis durations, often spanning
during days or even months. More recently, rapid synthesis routes have
emerged, enabling the production of high-purity Ag3SI and Ag3SBr powders at
temperatures below $600$ K through mechanochemistry methods luna23 .
Furthermore, advancements have also led to the synthesis of CAP solid
solutions, such as Ag3SBrxI1-x ($0\leq x\leq 1$), employing a rapid solution-
based chemical approach at moderate temperatures ($<500$ K) cano24 .

Figure 1: Sketch of some energetically competitive crystal structures
predicted with CSP-DFT methods for the archetypal silver-based chalcohalide
anti-perovskites Ag3SBr and Ag3SI. The cubic $Pm\overline{3}m$ phase that has
been experimentally identified as the corresponding room-temperature $\beta$
phase is shown for comparison. Additional representations of other
energetically competitive crystal structures are provided in the Supplementary
Fig.1.

Despite these recent experimental advances in synthesis, the phase stability
and structural properties of CAP remain inadequately investigated and
understood to date. For both Ag3SBr and Ag3SI, three distinct polymorphs have
been consistently reported: a low-temperature $\gamma$ phase ($<130$–$160$ K),
a room-temperature phase denoted as $\beta$ with low ionic conductivity, and
an $\alpha$ phase at high temperatures ($>500$ K) exhibiting high ionic Ag+
conductivity and S-/I- or S-/Br- chemical disorder hoshino78 ; sakuma80 ;
hoshino81 . Regarding Ag3SCl and other CAP compounds containing Se, to the
best of our knowledge, there is no experimental data available concerning
their structural and phase stability properties.

In the original reports by Hoshino _et al._ hoshino78 ; sakuma80 ; hoshino81 ,
the low-temperature $\gamma$ phase was described as trigonal with space group
$R3$ for Ag3SI and orthorhombic with space group $Cmcm$ for Ag3SBr. The room-
temperature $\beta$ phase for both Ag3SI and Ag3SBr was identified as cubic
with space group $Pm\overline{3}m$ and the high-temperature disordered
$\alpha$ phase as cubic with space group $Im\overline{3}m$ hull04 ; cho94 ;
yin20 . Additionally, a metastable room-temperature phase exhibiting high
ionic conductivity, denoted as $\alpha^{*}$ and obtained through quenching of
the $\alpha$ phase, has been reported for Ag3SI hull04 ; cho94 . However,
subsequent studies on Ag3SBr suggested that the crystal symmetry of the low-
temperature $\gamma$ phase could be more accurately described as monoclinic or
triclinic, rather than orthorhombic honda07 . Furthermore, investigations into
several Ag3SBrxI1-x solid solutions revealed that for a range of mixed
compositions, the low-temperature $\gamma$ phase was orthorhombic with space
group $Pnm2_{1}$ or $Pnmn$ honda07 .

Since all existing CAP synthesis methods involve temperatures above ambient
conditions, temperatures at which Ag3SI and Ag3SBr exhibit ionic conductivity,
it is highly probable that upon annealing the samples remain dynamically
arrested in metastable states characterized by ionic disorder. This phenomenon
is originated by the existence of significant energy barriers that hinder the
transition towards energetically more favorable and ordered phases. A similar
behavior has been recently demonstrated for halide hybrid perovskites
shahrokhi22 . This tendency poses a significant challenge in identifying truly
stable low-temperature phases in CAP. Systematic studies able to precisely
evaluate the relative stability among different CAP polymorphs are therefore
urgently needed. Such investigations are crucial for improving our fundamental
understanding of CAP and to properly assess their potential for possible
technological applications.

In this study, we employ theoretical first-principles methods based on density
functional theory to discern candidate stable phases for all CAP compounds at
both zero-temperature and $T\neq 0$ conditions. Notably, the predicted lowest-
energy CAP phases, systematically identified through crystal structure
prediction, ab initio molecular dynamics, and quasi-harmonic free energy
techniques, differ from those previously reported in experimental studies.
Therefore, besides providing original and valuable data for Ag3SCl and other
CAP compounds containing Se, the present study prompts a reassessment of the
established phase diagrams for Ag3SI and Ag3SBr, urging further experimental
investigations into CAP.

Figure 2: Energy of competitive crystal structures calculated for archetypal
CAP using different DFT exchange-correlation functionals. (a) Ag3SBr and (b)
Ag3SI. The energy of the cubic $Pm\overline{3}m$ phase that is experimentally
resolved at room temperature is shown for comparison.

##  II Results

Figure 3: Vibrational phonon spectrum of Ag3SBr calculated for different
crystal structures. Phonon calculations were performed at zero-temperature
conditions. All considered phases are vibrationally stable made the exception
of the cubic $Pm\overline{3}m$ phase, which exhibits abundant imaginary phonon
frequencies and branches. Results were obtained with the semi-local functional
PBEsol pbesol .

###  II.1 Zero-temperature crystal structure prediction

We conducted zero-temperature crystal structure prediction (CSP) calculations
for the two archetypal CAP compounds, Ag3SBr and Ag3SI, using the MAGUS
software magus  and considering a maximum of $20$ atoms per unit cell
(Methods). MAGUS employs an evolutionary algorithm augmented with machine
learning techniques and graph theory. The initial structures proposed by MAGUS
were subsequently relaxed using first-principles methods based on density
functional theory (DFT, Methods). Figure 1 illustrates some of the
energetically most favorable phases identified in the rankings resulting from
our CSP-DFT calculations (additional structural representations can be found
in Supplementary Fig.1). Notable among them are two distinct cubic structures
with space group $P2_{1}3$, an orthorhombic $P2_{1}2_{1}2_{1}$ phase, a
monoclinic $P2_{1}$ phase and a trigonal $R3$ phase.

Figure 4: Vibrational phonon spectrum of Ag3SI calculated for different
crystal structures. Phonon calculations were performed at zero-temperature
conditions. All considered phases are vibrationally stable made the exception
of the cubic $Pm\overline{3}m$ phase, which exhibits abundant imaginary phonon
frequencies and branches. Results were obtained with the semi-local functional
PBEsol pbesol .

Figure 2 presents the structure energy rankings obtained for Ag3SBr and Ag3SI
using various DFT semilocal exchange-correlation energy functionals, including
LDA lda , PBE pbe , PBEsol pbesol  and SCAN scan . For Ag3SBr, all the
examined DFT functionals consistently identify the cubic $P2_{1}3$ (I)
structure as the ground-state phase (Fig.2a). At $T=0$ K conditions, the
second energetically most favorable structure is an orthorhombic
$P2_{1}2_{1}2_{1}$ phase, followed by a cubic $P2_{1}3$ (II) and a trigonal
$R3$ phase. Notably, the PBE functional is the sole functional predicting the
cubic $P2_{1}3$ (II) phase to be marginally more favorable than the
orthorhombic $P2_{1}2_{1}2_{1}$ phase. Incorporating spin-orbit coupling (SOC)
effects in the DFT calculations appears inconsequential for determining the
most energetically competitive phases, as indicated by the similarity between
the PBEsol and PBEsol+SOC curves.

Remarkably, our crystal CSP-DFT calculations do not classify the orthorhombic
$Cmcm$ or the cubic $Pm\overline{3}m$ phases as energetically competitive,
despite their proposal as the $\gamma$ and $\beta$ phases of Ag3SBr from
experiments hoshino78 ; sakuma80 ; hoshino81 . Consistently, across all the
examined DFT functionals, the energy of these two phases is several hundreds
of meV per formula unit (f.u.) higher than that of the theoretical ground
state, the cubic $P2_{1}3$ (I) phase (Fig.2a).

For Ag3SI, the energy ranking is also dominated by the cubic $P2_{1}3$ (I)
phase, closely followed by a monoclinic $P2_{1}$ phase (Fig.2b). However, the
PBE functional deviates from the other energy functionals, suggesting an
orthorhombic $P2_{1}2_{1}2_{1}$ phase as the ground state. In this case,
accounting for SOC effects in the DFT calculations neither poses a significant
variation in the energy difference results, as evidenced by the nearly
identical curves for PBEsol and PBEsol+SOC. Another cubic $P2_{1}3$ (II) phase
emerges as energetically competitive across all surveyed DFT functionals.

Likewise to Ag3SBr, the energy of the experimentally observed low-temperature
trigonal $R3$ and room-temperature cubic $Pm\overline{3}m$ phases of Ag3SI is
estimated to be substantially higher than that of the corresponding ground-
state phase ($>0.1$ eV/f.u.) by all the examined functionals. It is worth
noting the similarity in energy among the trigonal $P3_{2}$ and $P3_{1}$
phases identified in our CSP-DFT calculations and the experimentally
identified trigonal $R3$ phase, which stems from their structural resemblance.

Figures 3–4 show the vibrational phonon spectra calculated for the four most
energetically favorable structures determined for Ag3SBr and Ag3SI at zero
temperature, respectively, along with those of the cubic $Pm\overline{3}m$
phase and another cubic $I2_{1}3$ phase introduced in the next section. Across
the four predicted stable polymorphs, we observe no imaginary phonon
frequencies along their high-symmetry reciprocal space paths, indicating their
vibrational stability. Notably, all these phases exhibit a wide frequency band
gap spanning approximately from $5.0$ to $7.5$ THz, with the exception of the
orthorhombic $P2_{1}2_{1}2_{1}$ phase that displays slightly lower frequencies
in the high-frequency regime.

Conversely, the cubic $Pm\overline{3}m$ phase, proposed as the room-
temperature $\beta$ phase of both Ag3SBr and Ag3SI sakuma80 ; hoshino81 ,
exhibits numerous imaginary phonon frequencies along all high-symmetry
reciprocal space paths, indicating its vibrational instability at $T=0$ K
conditions. A possible $T$-induced stabilization of this cubic
$Pm\overline{3}m$ phase will be discussed further in Sec.III. Additionally,
the orthorhombic $Cmcm$ phase, suggested as the low-temperature $\gamma$ phase
of Ag3SBr sakuma80 ; hoshino81 , exhibits also abundant imaginary phonon
frequencies (Supplementary Fig.2). Consequently, this phase is vibrationally
unstable at low temperatures and, even ignoring its highly unfavourable
energy, cannot be regarded as the ground-state phase. On the contrary, the
trigonal $R3$ phase, proposed as the low-temperature $\gamma$ phase of Ag3SI
sakuma80 ; hoshino81 , appears to be vibrationally stable at $T=0$ K
conditions (Supplementary Fig.2); however, in view of its high energy
(Fig.2b), this phase should be regarded as metastable in the low-temperature
regime.

As demonstrated in this section, our CSP-DFT calculations yield a
significantly different set of candidate ground-state phases compared to those
experimentally suggested for Ag3SBr and Ag3SI. Specifically, a cubic $P2_{1}3$
phase consistently emerges as the most energetically favorable phase at low
temperatures in our calculations, closely followed by an orthorhombic
$P2_{1}2_{1}2_{1}$ and a monoclinic $P2_{1}$ phase, depending on the material.
Importanly, these new candidate ground-state phases are all shown to be
vibrationally stable, contrasting with, for example, the orthorhombic $Cmcm$
phase proposed as the lowest energy structure of Ag3SBr. Consequently, our
theoretical findings call for a reevaluation of previous experimental
characterizations of CAP conducted at low temperatures.

Figure 5: Analysis of the vibrational stability and ionic diffusion of Ag3SBr
in the cubic $Pm\overline{3}m$ phase at $T\neq 0$ conditions. (a)–(b) Position
correlation function cazorla12 ; cazorla14 , $p(\Delta t)$, estimated at
$T=200$ and $600$ K. (c)–(d) Mean square displacement, $\Delta r^{2}(\Delta
t)$, estimated at $T=200$ and $600$ K. Results were obtained from ab initio
molecular dynamics simulations (Methods) performed with the semi-local
functional PBEsol pbesol . Figure 6: Analysis of the vibrational stability and
ionic diffusion of Ag3SI in the cubic $Pm\overline{3}m$ phase at $T\neq 0$
conditions. (a)–(b) Position correlation function cazorla12 ; cazorla14 ,
$p(\Delta t)$, estimated at $T=200$ and $600$ K. (c)–(d) Mean square
displacement, $\Delta r^{2}(\Delta t)$, estimated at $T=200$ and $600$ K.
Results were obtained from ab initio molecular dynamics simulations (Methods)
performed with the semi-local functional PBEsol pbesol . Figure 7: Analysis of
Ag ion trajectories obtained from ab initio molecular dynamics simulations.
Ag3SBr in the cubic $Pm\overline{3}m$ phase at (a) $T=200$ K and (c) $T=600$
K. Ag3SI in the cubic $Pm\overline{3}m$ phase at (b) $T=200$ K and (d) $T=600$
K. Results were obtained with the semi-local functional PBEsol pbesol . Figure
8: Ag3SI supercell representations obtained from ab initio molecular dynamics
simulations. (a) The starting cubic $Pm\overline{3}m$ phase at zero
temperature. (b) The distorted cubic $Pm\overline{3}m$ phase found at $T=200$
K. (c) The new cubic $I2_{1}3$ phase determined from the distorted cubic
$Pm\overline{3}m$ phase. Ag, S and I ions are represented with grey, yellow
and purple spheres, respectively. Results were obtained with the semi-local
functional PBEsol pbesol .

###  II.2 Finite-temperature crystal structure prediction

The observed low-temperature vibrational instability of the cubic
$Pm\overline{3}m$ phase (Figs.3–4), proposed as the room-temperature $\beta$
phase of both Ag3SBr and Ag3SI sakuma80 ; hoshino81 , prompted us to perform
comprehensive _ab initio_ molecular dynamics (AIMD) simulations at $T\neq 0$ K
conditions (Methods). The primary objective of these dynamical simulations was
to assess the vibrational stability of this phase at finite temperatures as
well as to evaluate its ionic transport properties. All the results presented
in what follows, if not stated otherwise, were obtained with the semilocal
PBEsol exchange-correlation energy functional pbesol .

Figure 5 shows the position correlation function, $p(\Delta t)$, and mean
square displacement, $\Delta r(\Delta t)$, estimated for Ag3SBr at $T=200$ and
$600$ K. These time-dependent functions are defined as cazorla12 ; cazorla14 :

$\displaystyle p(\Delta t)=\langle[{\bf r_{i}}(\Delta t+t_{0})-{\bf
R_{i}}^{0}]\cdot[{\bf r_{i}}(t_{0})-{\bf R_{i}}^{0}]\rangle$ (1)
$\displaystyle\Delta r^{2}(\Delta t)=\langle[{\bf r_{i}}(\Delta t+t_{0})-{\bf
r_{i}}(t_{0})]^{2}\rangle~{},$ (2)

where ${\bf r_{i}}$ represents the position vector of atom $i$, $t_{0}$ an
arbitrary time origin, ${\bf R_{i}}^{0}$ the position vector of the
equilibrium lattice site for atom $i$, and $\langle\cdots\rangle$ thermal
average performed over particles and time origins.

At $\Delta t=0$, $p$ is simply the vibrational mean square displacement. The
crystal is vibrationally stable if $p(\Delta t\to\infty)=0$, because the
vibrational displacements at widely separated times become uncorrelated.
Conversely, if the atoms acquire a permanent vibrational displacement,
$p(\Delta t\to\infty)$ becomes nonzero. On the other hand, in the absence of
ionic diffusion, $\Delta r^{2}$ converges to a constant equal to twice the
vibrational mean square displacement in the limit $\Delta t\to\infty$.
Contrarily, in the presence of ionic diffusion, $\Delta r^{2}$ exhibits a
linear dependence on $\Delta t$ with a positively defined slope at
sufficiently long times.

The $p$ and $\Delta r^{2}$ results presented in Fig.5 indicate that Ag3SBr in
the cubic $Pm\overline{3}m$ phase is vibrationally stable at $T=200$ K and
exhibits significant Ag ionic diffusion at $T=600$ K. The slow decay of $p$
and large asymptotic value of $\Delta r^{2}$ estimated for Ag ions at $T=200$
K indicate high anharmonicity, despite of the low temperature. In contrast,
the $p$ and $\Delta r^{2}$ results presented in Fig.6 indicate a markedly
different behavior for Ag3SI. Specifically, the vibrational centers of Ag ions
somewhat change throughout the $T=200$ K simulation, $\\{{\bf
R_{i}}^{0}\\}\to\\{{\bf R_{i}}^{*}\\}$, since $p(\Delta t\to\infty)\neq 0$ for
these atoms. Furthermore at high temperatures, the Ag ionic diffusion is
appreciably higher in Ag3SI than in Ag3SBr.

Figure 7 shows the simulated trajectory of an arbitrary silver ion in Ag3SBr
and Ag3SI at different temperatures. At $T=200$ K, the map of position points
is more anisotropic for Ag3SI than for Ag3SBr. Specifically, multiple
vibrational centers can be identified for Ag3SI (Fig.7b), whereas they are not
observed for Ag3SBr (Fig.7a). Notably, the amplitude of the ionic vibrations
in Ag3SBr is very wide, thus denoting high anharmonicity. These observations
are consistent with the $p$ results presented in Figs.5–6 for Ag ions. At
$T=600$ K, on the other hand, silver ionic hoppings are clearly observed in
both compounds, illustrating their superionic character at high temperatures.

In an attempt to identify the crystal structure towards which Ag3SI appears to
transform from the cubic $Pm\overline{3}m$ phase, we performed annealing
(i.e., zero-temperature geometry relaxation) on a series of supercell
configurations extracted from the AIMD runs (Fig.8). Figure 8b shows the
lowest-energy configuration obtained through this process, which contains a
total of $320$ atoms. Using the FINDSYM software findsym , this supercell was
efficiently reduced to a cubic $40$-atom primitive cell with space group
$I2_{1}3$ (Fig.8c). Interestingly, this new cubic $I2_{1}3$ phase was found to
be vibrationally stable at low temperatures for both Ag3SBr and Ag3SI
(Figs.3–4). As discussed in the next section, this new cubic $I2_{1}3$ phase
was also found to be energetically competitive with respect to the ground-
state phases determined for most silver chalcohalide anti-perovskite (CAP).

Compound | Structure | Symmetry |  $a$ (Å) |  $b$ (Å) |  $c$ (Å) |  $\alpha$ $(^{\circ})$ |  $\beta$ $(^{\circ})$ |  $\gamma$ $(^{\circ})$ |  $\Delta E$ (meV/f.u.) |  $\Delta E^{\rm{ZPE}}$ (meV/f.u.)
---|---|---|---|---|---|---|---|---|---|---
Ag3SCl | Cubic |  $P2_{1}3$ (I) | 7.478 | 7.478 | 7.478 | 90.000 | 90.000 | 90.000 | 0 | 0
Orthorhombic | $P2_{1}2_{1}2_{1}$ | 4.502 | 4.455 | 20.715 | 90.000 | 90.000 | 90.000 | 65 | 64
Orthorhombic | $Pca2_{1}$ | 5.872 | 9.757 | 6.877 | 90.000 | 90.000 | 90.000 | 79 | 78
Cubic |  $P2_{1}3$ (II) | 7.499 | 7.499 | 7.499 | 90.000 | 90.000 | 90.000 | 89 | 89
Cubic | $I2_{1}3$ | 9.389 | 9.389 | 9.389 | 90.000 | 90.000 | 90.000 | 181 | –
Cubic | $Pm\overline{3}m$ | 4.750 | 4.750 | 4.750 | 90.000 | 90.000 | 90.000 | 627 | –
Ag3SBr | Cubic |  $P2_{1}3$ (I) | 7.586 | 7.586 | 7.586 | 90.000 | 90.000 | 90.000 | 0 | 0
Orthorhombic | $P2_{1}2_{1}2_{1}$ | 4.518 | 4.531 | 21.152 | 90.000 | 90.000 | 90.000 | 79 | 77
Cubic |  $P2_{1}3$ (II) | 7.602 | 7.602 | 7.602 | 90.000 | 90.000 | 90.000 | 91 | 90
Cubic | $I2_{1}3$ | 9.446 | 9.446 | 9.446 | 90.000 | 90.000 | 90.000 | 117 | 109
Trigonal | $R3$ | 8.140 | 8.140 | 8.140 | 109.075 | 109.075 | 109.075 | 121 | 115
Cubic | $Pm\overline{3}m$ | 4.793 | 4.793 | 4.793 | 90.000 | 90.000 | 90.000 | 538 | –
Ag3SI | Cubic |  $P2_{1}3$ (I) | 7.734 | 7.734 | 7.734 | 90.000 | 90.000 | 90.000 | 0 | 0
Cubic | $I2_{1}3$ | 9.568 | 9.568 | 9.568 | 90.000 | 90.000 | 90.000 | 53 | 47
Monoclinic | $P2_{1}$ | 6.176 | 6.984 | 5.656 | 90.000 | 90.000 | 93.869 | 55 | 55
Cubic |  $P2_{1}3$ (II) | 7.739 | 7.739 | 7.739 | 90.000 | 90.000 | 90.000 | 67 | 73
Orthorhombic | $P2_{1}2_{1}2_{1}$ | 4.563 | 4.612 | 21.767 | 90.000 | 90.000 | 90.000 | 79 | 77
Cubic | $Pm\overline{3}m$ | 4.869 | 4.869 | 4.869 | 90.000 | 90.000 | 90.000 | 516 | –
Ag3SeCl | Orthorhombic | $Pca2_{1}$ | 5.879 | 10.014 | 6.980 | 90.000 | 90.000 | 90.000 | 0 | 0
Orthorhombic |  $P2_{1}2_{1}2_{1}$ (I) | 4.688 | 4.475 | 21.053 | 90.000 | 90.000 | 90.000 | 4 | 4
Orthorhombic |  $P2_{1}2_{1}2_{1}$ (II) | 5.761 | 5.743 | 12.651 | 90.000 | 90.000 | 90.000 | 38 | 39
Orthorhombic | $Pna2_{1}$ | 6.347 | 6.450 | 9.966 | 90.000 | 90.000 | 90.000 | 43 | 38
Cubic | $I2_{1}3$ | 9.626 | 9.626 | 9.626 | 90.000 | 90.000 | 90.000 | 117 | –
Cubic | $Pm\overline{3}m$ | 4.930 | 4.930 | 4.930 | 90.000 | 90.000 | 90.000 | 1072 | –
Ag3SeBr | Orthorhombic |  $P2_{1}2_{1}2_{1}$ (I) | 4.706 | 4.562 | 21.452 | 90.000 | 90.000 | 90.000 | 0 | 0
Orthorhombic |  $P2_{1}2_{1}2$ (II) | 7.530 | 14.614 | 4.365 | 90.000 | 90.000 | 90.000 | 10 | 9
Cubic | $I2_{1}3$ | 9.678 | 9.678 | 9.678 | 90.000 | 90.000 | 90.000 | 41 | 37
Cubic |  $P2_{1}3$ (I) | 7.739 | 7.739 | 7.739 | 90.000 | 90.000 | 90.000 | 47 | 46
Cubic |  $P2_{1}3$ (II) | 7.737 | 7.737 | 7.737 | 90.000 | 90.000 | 90.000 | 49 | 48
Cubic | $Pm\overline{3}m$ | 4.962 | 4.962 | 4.962 | 90.000 | 90.000 | 90.000 | 916 | –
Ag3SeI | Cubic | $I2_{1}3$ | 9.782 | 9.782 | 9.782 | 90.000 | 90.000 | 90.000 | 0 | 0
Orthorhombic | $P2_{1}2_{1}2_{1}$ | 4.761 | 4.653 | 21.970 | 90.000 | 90.000 | 90.000 | 19 | 22
Trigonal | $P3_{1}$ | 6.949 | 6.949 | 8.388 | 90.000 | 90.000 | 120.000 | 52 | 51
Monoclinic | $P2_{1}$ | 7.708 | 7.225 | 15.533 | 90.000 | 90.000 | 144.418 | 66 | 70
Cubic |  $P2_{1}3$ (I) | 7.978 | 7.978 | 7.978 | 90.000 | 90.000 | 90.000 | 69 | 68
Cubic | $Pm\overline{3}m$ | 5.022 | 5.022 | 5.022 | 90.000 | 90.000 | 90.000 | 842 | –
Table 1: Structural and energy properties of CAP considering several
energetically competitive phases. Energy differences, $\Delta E$, are referred
to the ground-state phase and expressed in units of meV per formula unit
(f.u.). Energy differences including zero-point energy (ZPE) corrections
(Methods) are also reported, $\Delta E^{\rm ZPE}$, except for those phases
that were found to exhibit imaginary phonon frequencies. Results were obtained
with the semi-local functional PBEsol pbesol . Figure 9: CAP phase competition
determined at zero-temperature conditions. Energy differences neglecting
(including) ZPE corrections (Methods) are represented with solid (dashed)
lines. Results were obtained with the semi-local functional PBEsol pbesol .

###  II.3 Zero-temperature phase competition

After the detailed study of the structural and vibrational properties of
Ag3SBr and Ag3SI, we extended our investigation to other materials in the CAP
family, namely, Ag3SCl, Ag3SeCl, Ag3SeBr and Ag3SeI. It is worth noting that,
to the best of our knowledge, there are not experimental reports on these
compounds in the literature. For each new CAP, we began by relaxing the $60$
lowest-energy phases identified for the archetypal compounds Ag3SBr and Ag3SI,
using the semilocal PBEsol exchange-correlation energy functional pbesol . The
cubic $I2_{1}3$ phase discovered from the AIMD simulations performed for Ag3SI
and the experimental room-temperature cubic $Pm\overline{3}m$ phase, were
additionally considered in our pool of candidate ground-state phases.

Figure 9 and Table 1 summarize our zero-temperature DFT structure energy
rankings obtained for the CAP family. For Ag3SBr and Ag3SI, the primary
difference compared to the results in Fig.2 is the inclusion of the new cubic
$I2_{1}3$ phase. This phase has an energy only $45$ meV/f.u. higher than the
cubic $P2_{1}3$ (I) ground-state phase in Ag3SI, and approximately $100$
meV/f.u. higher than the same ground-state phase in Ag3SBr. For the analogous
Se-based CAP, the cubic $I2_{1}3$ phase is even more relevant; it has the
lowest energy for Ag3SeI, and for Ag3SeBr its energy is only about $35$
meV/f.u. higher than that of the orthorhombic $P2_{1}2_{1}2_{1}$ ground-state
phase (Fig.9).

The ground-state phase of all analyzed S-based CAP corresponds to the cubic
$P2_{1}3$ (I) phase, which in the Ag3SCl system is closely followed by two
orthorhombic phases with symmetries $P2_{1}2_{1}2_{1}$ and $Pca2_{1}$.
Regarding the Se-based CAP, in Ag3SeCl and Ag3SeBr, the lowest-energy phases
are dominated by orthorhombic phases (e.g., $P2_{1}2_{1}2_{1}$ and
$Pca2_{1}$), the cubic $I2_{1}3$ phase being the most significant energy
competitor presenting a different crystal symmetry. In the specific case of
Ag3SeI, a trigonal $P3_{1}$ and a monoclinic $P2_{1}$ phase were also ranked
among the lowest-energy structures.

We computed the lattice phonon spectrum of the experimental room-temperature
cubic $Pm\overline{3}m$ phase and the five energetically most favourable
structures found for Ag3SCl, Ag3SeCl, Ag3SeBr and Ag3SeI (Supplementary
Figs.3–6). Without any exception, we found that the cubic $Pm\overline{3}m$
phase always exhibits abundant imaginary phonon frequencies. The cubic
$I2_{1}3$ phase is also vibrationally unstable for Ag3SCl and Ag3SeCl at low
temperatures (Supplementary Figs.3–4). However, the remaining phases are
perfectly vibrationally stable for all the targeted CAP (Supplementary
Figs.3–6).

For the structures that exclusively exhibited real and positively defined
phonon frequencies, we corrected their zero-temperature energies to account
for likely quantum zero-point effects (ZPE) cazorla17 ; cazorla09 ; cazorla22
. It is worth noting that applying quasi-harmonic (QH) approaches to materials
that exhibit imaginary phonon frequencies is neither physically nor
mathematically well-justified cazorla17 . Thus, any QH result obtained for
phases that exhibit imaginary phonon frequencies (e.g., the cubic
$Pm\overline{3}m$ phase for all CAP compounds) cannot be rigorously trusted as
quantitatively correct yin20 . As shown in Fig.9 and Table 1, accounting for
quantum ZPE has a practically negligible effect on the energy rankings
obtained using classical mechanics. Only in the specific cases of Ag3SeCl and
Ag3SeI, quantum ZPE exchange the ordering between the third and fourth and the
fourth and fifth most energetically favourable phases, respectively.

Figure 10: CAP phase competition determined at $T\neq 0$ conditions. QH
Helmholtz free-energy differences, $\Delta G$, were calculated within the
quasi-harmonic approximation (Methods) cazorla17 ; cazorla09 ; cazorla22 .
Results were obtained with the semi-local functional PBEsol pbesol .

###  II.4 Finite-temperature phase competition

To predict likely $T$-induced phase transitions across the CAP family, we
applied the QH free-energy formalism cazorla17 ; cazorla09 ; cazorla22  to all
the phases reported in Fig.9 that were vibrationally stable at low
temperatures. It is worth emphasizing that applying QH approaches to phases
that exhibit imaginary phonon frequencies is neither physically nor
mathematically well-justified cazorla17 . Consequently, phases like the cubic
$Pm\overline{3}m$ and orthorhombic $Cmcm$ in Ag3SBr, for example, were
excluded from our phase competition analysis conducted at $T\neq 0$ K
conditions.

Figure 10 shows the QH (Helmholtz) free-energy differences estimated as a
function of temperature for the six CAP compounds targeted in this study. At a
given temperature, the phase exhibiting the lowest free energy ($G$) is the
equilibrium, or stable, phase. The remaining phases, which are vibrationally
stable in principle, are considered metastable. A $T$-induced phase transition
occurs when the free-energy curve of the equilibrium phase crosses the free-
energy curve of a metastable phase. The temperature at which this crossing
occurs defines the corresponding phase transition temperature.

For the S-based CAP, we did not find any $T$-induced phase transition up to
$800$ K as evidenced by the lack of $G$ curve crossings involving the cubic
$P2_{1}3$ (I) phase. Considering higher temperatures probably is not
physically meaningful due to the imminent stabilization of the liquid phase
luna23 ; cano24 . Several $G$ curve crossings involving pairs of metastable
phases are observed in Figs.10b–c; however, such metastable phase transitions
are not of interest in this study. Consequently, according to our QH free-
energy DFT calculations, the cubic $P2_{1}3$ (I) phase, rather than the cubic
$Pm\overline{3}m$ phase, is the equilibrium, or stable, phase of Ag3SCl,
Ag3SBr and Ag3SI at room temperature.

For the Se-based CAP, the equilibrium between different phases is appreciably
affected by temperature. Specifically, we predict two phase transitions for
Ag3SeCl: the first occurrs between the two orthorhombic phases $Pca2_{1}$ and
$P2_{1}2_{1}2_{1}$ (I) at $150$ K, and the second between the two orthorhombic
phases $P2_{1}2_{1}2_{1}$ (I) and $Pna2_{1}$ at $430$ K (Fig.10d). For
Ag3SeBr, another phase transition is predicted to occur between the two
orthorhombic phases $P2_{1}2_{1}2_{1}$ (I) and $P2_{1}2_{1}2_{1}$ (II) at
$210$ K (Fig.10e). Finally, for Ag3SeI no $T$-induced phase transition is
observed (Fig.10f). Consequently, according to our QH free-energy DFT
calculations, the equilibrium room-temperature phase is orthorhombic
$P2_{1}2_{1}2_{1}$ for Ag3SeCl and Ag3SeBr, and cubic $I2_{1}3$ for Ag3SeI.

Figure 11: Experimental X-ray characterization of CAP at room temperature. (a)
Ag3SBr and (b) Ag3SI. Theoretical DFT results obtained for different
energetically competitive phases are shown for comparison. Figure 12:
Temperature-renormalized vibrational phonon spectrum of CAP in the cubic
$Pm\overline{3}m$ phase. (a) Ag3SBr and (b) Ag3SI. Phonon frequencies obtained
at $T=100$ K (Methods) are represented with orange lines. Zero-temperature
phonon frequencies are represented with blue lines. Results were obtained with
the semi-local functional PBEsol pbesol .

##  III Discussion

Figure 11 shows the experimental X-ray diffraction patterns obtained for two
Ag3SBr and Ag3SI samples synthesized through the chemical route detailed in
work cano24  (Methods). At room temperature, based on phase identification
protocols using Rietveld fits, the Ag3SBr polycrystal was optimally indexed as
cubic $Pm\overline{3}m$ and the Ag3SI polycrystal as cubic $Im\overline{3}m$
(due to the presence of ionic disorder). In the same plot, the theoretical
X-ray diffraction patterns of several phases obtained from our DFT simulations
are included for comparison. The experimental X-ray diffraction pattern of the
Ag3SBr sample perfectly agrees with the theoretical X-ray diffraction pattern
of the simulated cubic $Pm\overline{3}m$ phase (Fig.11a). On the other hand,
the experimental X-ray diffraction pattern of the Ag3SI sample cannot be
assigned to the theoretical X-ray diffraction pattern of any single ordered
structure (Fig.11b).

The experimental X-ray diffraction patterns enclosed in Fig.11, along with the
computational _ab initio_ findings presented in the preceding sections, raise
the following question: why is the cubic $Pm\overline{3}m$ phase, or a similar
disordered phase, experimentally observed in Ag3SBr and Ag3SI at room
temperature, instead of the theoretically predicted equilibrium cubic
$P2_{1}3$ phase? Although we cannot provide a definitive answer to this
question, we can offer some reasonable hypotheses.

First, it is noted that despite the cubic $Pm\overline{3}m$ phase being
vibrationally unstable at very low temperatures (Figs.3–4), it could be
stabilized by increasing temperature, similar to what is observed in
archetypal oxide perovkites ehsan22 ; cazorla24 . To evaluate this
possibility, we computed the $T$-renormalized phonon spectrum of this phase
for Ag3SBr and Ag3SI following a dynamical normal-mode-decomposition technique
(Methods) dynaphopy . Using a relatively small $2\times 2\times 2$ supercell
for the AIMD simulations ($T=100$ K) involved in this phonon renormalization
process to maintain high numerical accuracy (Supplementary Discussion and
Supplementary Fig.7), we found that the cubic $Pm\overline{3}m$ phase is
practically vibrationally stabilized by thermal effects (Fig.12).

Importantly, a few imaginary phonon frequencies are still present in the
$T$-renormalized vibrational spectra shown in Fig.12, which precluded us from
estimating the QH free energy of the cubic $Pm\overline{3}m$ phase and compare
it with those of other phases. It is noted that when performing
$T$-renormalized phonon calculations at temperatures higher than $100$ K, the
number of imaginary phonon frequencies increased due to the appearance of
ionic diffusion in the AIMD simulations. Nevertheless, despite all these
technical complexities and possible numerical artifacts (Supplementary
Discussion), it seems reasonable to think that the highly anharmonic cubic
$Pm\overline{3}m$ phase can be fully vibrationally stabilized by effect of
temperature.

Based on the presented theoretical findings, our main hypothesis is that
current synthesis methods, all of which involve temperatures significantly
higher than $300$ K, inevitably trap CAP compounds into metastable states. A
key feature, possibly explaining the room-temperature metastability of the
synthesized CAP compounds, may be superionicity. According to our AIMD
simulations (Supplementary Figs.8–9), Ag3SBr in the cubic $Pm\overline{3}m$
phase becomes superionic at $T=300~{}(100)$ K. On other hand, the equibrium
cubic $P2_{1}3$ phase exhibits no ionic diffusivity at room temperature.
Consequently, it is likely that at temperatures higher than $300$ K, such as
those involved in CAP synthesis methods, the cubic $Pm\overline{3}m$ phase is
further stabilized due to the entropy gain that accompanies ionic diffusion,
eventually becoming the equilibrium phase. (Unfortunately, this type of
entropy enhancement currently cannot be reproduced by our QH free-energy DFT
calculations.) In that hypothetical case, it seems plausible that upon
annealing the system becomes trapped in the cubic $Pm\overline{3}m$ phase with
little possibility to nucleate the equilibrium ordered phase corresponding to
lower temperatures.

##  IV Conclusions

For the highly anharmonic and archetypal CAP compounds Ag3SBr and Ag3SI, our
systematic, comprehensive and technically sound first-principles study suggest
a completely different set of stable phases, both at zero temperature and
$T\neq 0$ K conditions, compared to what has been proposed from experiments.
Specifically, a new cubic $P2_{1}3$ phase is found to exhibit the lowest
energy at $T=0$ K and the lowest free energy at finite temperatures, being
several hundreds of meV per formula unit lower than the experimentally
proposed trigonal $R3$ and orthorhombic $Cmcm$ phases. Additionally, we
propose different ground-state phases and $T$-induced phase transitions for
the less investigated CAP compounds Ag3SCl, Ag3SeCl, Ag3SeBr and Ag3SeI.

An interesting consequence of our theoretical findings is that the cubic
$Pm\overline{3}m$ phase experimentally observed at room temperature may be
metastable. The relatively high temperatures involved in current synthesis
methods and the significant superionicity of CAP above room temperature may be
key factors in understanding this metastability. It is worth noting that
metastable phases have a natural tendency to fluctuate between different
energy states, which may pose stability issues for practical technological
applications. Thus, the present computational study calls for a revision of
the assumed phase diagram of CAP compounds and motivates new structural
characterization experiments conducted under varying temperature conditions,
particularly in the low-temperature regime.

## Methods

First-principles calculations outline. Ab initio calculations based on density
functional theory (DFT) cazorla17  were performed to analyse the structural
and phase stability properties of CAP. We performed these calculations with
the VASP code vasp  using different approximations to the exchange-correlation
energy, namely, the semi-local functionals LDA lda , PBE pbe , PBEsol pbesol
and SCAN scan . The projector augmented-wave method was used to represent the
ionic cores bloch94  and the following electronic states were considered as
valence: Ag $5s$ $4d$, S $3s$ $3p$, Se $4s$ $4p$, Cl $3s$ $3p$, Br $4s$ $4p$,
I $5s$ $5p$. Wave functions were represented in a plane-wave basis typically
truncated at $650$ eV. By using these parameters and dense ${\bf k}$-point
grids for reciprocal-space integration (e.g., of $8\times 8\times 8$ for the
cubic $Pm\overline{3}m$ phase), the resulting zero-temperature energies were
converged to within $1$ meV per formula unit. In the geometry relaxations, a
force tolerance of $0.005$ eV$\cdot$Å-1 was imposed.

Harmonic and anharmonic phonon and free-energy calculations. The second-order
interatomic force constant of all CAP and resulting harmonic phonon spectrum
were calculated with the finite-differences method as is implemented in the
PhonoPy software phonopy . Large supercells (e.g., $4\times 4\times 4$ for the
cubic $Pm\overline{3}m$ phase containing $320$ atoms) were employed for all
the targeted structures. Zero-point energy (ZPE) corrections and finite-
temperature Helmholtz free energies ($G$) were calculated within the quasi-
harmonic approximation cazorla17 ; cazorla09 ; cazorla22 . Due to the large
number of materials and phases analyzed in this study, thermal expansion
effects were disregarded in our ZPE and $G$ calculations.

The DynaPhoPy code dynaphopy  was used to calculate the anharmonic lattice
dynamics (i.e., $T$-renormalized phonons) of Ag3SBr and Ag3SI in the cubic
$Pm\overline{3}m$ phase from ab initio molecular dynamics (AIMD) simulations.
In this case, a reduced $2\times 2\times 2$ supercell and $4\times 4\times 4$
k-point grid for reciprocal-space sampling were employed in the AIMD
simulations to maintain high numerical accuracy (Supplementary Discussion).

A normal-mode-decomposition technique was employed in which the atomic
velocities $\textbf{v}_{jl}(t)$ ($j$ and $l$ represent particle and Cartesian
direction indexes) generated during fixed-temperature AIMD simulation runs
were expressed like:

$\textbf{v}_{jl}(t)=\frac{1}{\sqrt{Nm_{j}}}\sum_{\textbf{q}s}\textbf{e}_{j}(\textbf{q},s)e^{i\textbf{q}\textbf{R}_{jl}^{0}}v_{\textbf{q}s}(t)~{},$
(3)

where $N$ is the number of particles, $m_{j}$ the mass of particle $j$,
$\textbf{e}_{j}(\textbf{q},s)$ a phonon mode eigenvector (q and $s$ stand for
the wave vector and phonon branch), $\textbf{R}_{jl}^{0}$ the equilibrium
position of particle $j$, and $v_{\textbf{q}s}$ the velocity of the
corresponding phonon quasiparticle.

The Fourier transform of the autocorrelation function of $v_{\textbf{q}s}$
then was calculated, yielding the power spectrum:

$G_{\textbf{q}s}(\omega)=2\int_{-\infty}^{\infty}\langle
v_{\textbf{q}s}^{*}(0)v_{\textbf{q}s}(t)\rangle e^{i\omega t}dt~{}.$ (4)

Finally, this power spectrum was approximated by a Lorentzian function of the
form:

$G_{\textbf{q}s}(\omega)\approx\frac{\langle|v_{\textbf{q}s}|^{2}\rangle}{\frac{1}{2}\gamma_{\textbf{q}s}\pi\left[1+\left(\frac{\omega-\omega_{\textbf{q}s}}{\frac{1}{2}\gamma_{\textbf{q}s}}\right)^{2}\right]}~{},$
(5)

from which a $T$-renormalized quasiparticle phonon frequency,
$\omega_{\textbf{q}s}(T)$, was determined as the peak position, and the
corresponding phonon linewidth, $\gamma_{\textbf{q}s}(T)$, as the full width
at half maximum.

First-principles molecular dynamics simulations.  _Ab initio_ molecular
dynamics simulations based on DFT were performed in the canonical $(N,V,T)$
ensemble (i.e., constant number of particles, volume and temperature). The
selected volumes were those determined at zero temperature hence thermal
expansion effects were neglected. The temperature in the AIMD simulations was
kept fluctuating around a set-point value by using Nose-Hoover thermostats.
Large simulation boxes containing $N\sim 200$–$400$ atoms were employed (e.g.,
for the cubic $Pm\overline{3}m$ phase we adopted a $4\times 4\times 4$
supercell contaning $320$ atoms) and periodic boundary conditions were applied
along the three supercell lattice vectors. Newton’s equations of motion were
integrated using the customary Verlet’s algorithm with a time step of
$1.5\cdot 10^{-3}$ ps. $\Gamma$-point sampling for reciprocal-space
integration was employed in most of the AIMD simulations, which comprised long
simulation times of $80$–$100$ ps.

Crystal structure searches. We used the MAGUS software (Machine learning And
Graph theory assisted Universal structure Searcher) magus  to find new
candidate stable and metastable phases for the archetypal CAP Ag3SBr and
Ag3SI. This crystal structure prediction software employs an evolutionary
algorithm augmented with machine learning and graph theory to reduce the cost
of the geometry optimizations. The crystal phase searches were conducted for
structures containing a maximum of $4$ formula units (i.e., $20$ atoms per
unit cell).

Experimental procedure. Ag3SBr and Ag3SI were synthesized following the
chemical route described in work cano24 . The samples were analyzed through
X-ray diffraction using a Bruker D8 advanced diffractometer equipped with a
Cu-based tube ($40$ kV, $40$ mA) and a Sol-X detector with discriminator for
the $K_{\beta}$ line and fluorescence effect reduction. The measurements were
made using grazing incidence configuration.

## Data availability

The data that support the findings of this study are freely available at the
NOMAD data management platform for materials science nomad1 . These data
include the VASP input files of our first-principles DFT calculations as well
as some key output files (e.g., relaxed atomic positions of all relevant
crystal structures) nomad2 .

## Acknowledgements

C.C. acknowledges support from the Spanish Ministry of Science, Innovation and
Universities under the fellowship RYC2018-024947-I and grants
PID2020-112975GB-I00 and grant TED2021-130265B-C22. The authors also
thankfully acknowledge technical support the computational resources at
MareNostrum4 provided by Barcelona Supercomputing Center (FI-2023-1-0002,
FI-2023-2-0004, FI-2023-3-0004 and FI-2024-1-0005). P.B. acknowledges support
from the Generalitat de Catalunya under a FI grant. C.L. acknowledges support
from the Spanish Ministry of Science, Innovation and Universities under a FPU
grant.

## References

  * (1) Palazon, F. Metal chalcohalides: Next generation photovoltaic materials? Sol. RRL 6, 2100829 (2022).
  * (2) Ghorpade, U.V., Suryawanshi, M. P., Green, M. A., Wu, T., Hao, X. and Ryan, K. M. Emerging chalcohalide materials for energy applications. Chem. Rev. 123, 327 (2023).
  * (3) Sebastiá-Luna, L., Rodkey, N., Mirza, A. S., Mertens, S., Lal, Melchor, A., Carranza, G., Calbo, J., Righetto, M., Sessolo, M., Herz, L. M., Vandewal, K., Ortí, E., Morales-Masis, M., Bolink, H. J. and Palazon, F. Chalcohalide antiperovskite thin films with visible light absorption and high charge-carrier mobility processed by solvent-free and low-temperature methods. Chem. Mater. 35, 6482 (2023).
  * (4) Caño, I., Turnley, J. W., Benítez, P., López-Álvarez, C., Asensi, J.-M., Payno, D., Puigdollers, J., Placidi, M., Cazorla, C., Agrawal, R. and Saucedo, E. Novel synthesis of semiconductor chalcohalide anti-perovskites by low-temperature molecular precursor ink deposition methodologies. J. Chem. Mater. C 12, 3154 (2024).
  * (5) Takahashi, T. and Yamamoto, O. The Ag/Ag3SI/I2 solid-electrolyte cell. Electrochim. Acta 11, 779 (1966).
  * (6) Hull, S. Superionics: crystal structures and conduction processes. Rep. Prog. Phys. 67, 1233 (2004).
  * (7) Wakamura, K., Miura, F., Kojima, A. and Kanashiro, T. Observation of anomalously increasing phonon damping constant in the $\beta$ phase of the fast-ionic conductor Ag3SI. Phys. Rev. B 41, 2758 (1990).
  * (8) Sakuma, T. Treatment of anharmonic thermal vibration by using transformation of scattering vector. J. Phys. Soc. Jpn. 54, 4188 (1985).
  * (9) Kawamura, J., Shimoji, M. and Hoshino, H. The ionic conductivity and thermoelectric power of the superionic conductor Ag3SBr. J. Phys. Soc. Jpn. 50, 194 (1981).
  * (10) Magistris, A., Pezzati, E. and Sinistri, C. Thermoelectric properties of high-conductivity solid electrolytes. Z. Naturforsch. 27a, 1379 (1972).
  * (11) Reuter, B. and Hardel, K. Silbersulfidbromid und silbersulfidjodid. Angew. Chem. 72, 138 (1960).
  * (12) Hoshino, S., Sakuma, T. and Fujii, Y. The existence of the order phase in superionic conductor Ag3SI. J. Phys. Soc. Jpn. 45, 705 (1978).
  * (13) Sakuma, T. and Hoshino, S. The phase transition and the structures of superionic conductor Ag3SBr. J. Phys. Soc. Jpn. 49, 678 (1980).
  * (14) Hoshino, S., Fujishita, H., Takashige, M. and Sakuma, T. Phase transition of Ag3SX (X= I, Br). Solid State Ion. 3, 35 (1981).
  * (15) Cho, N., Kikkawa, S., Kanamaru, F. and Yoshiasa, A. Structural refinement of Ag3SI by single crystal X-ray diffraction method. Solid State Ion. 68, 57 (1994).
  * (16) Yin, L., Murphy, M., Kim, K., Hu, L., Cabana, J., Siegel, D. J. and Lapidus, S. H. Synthesis of antiperovskite solid electrolytes: comparing Li3SI,Na3SI, and Ag3SI. Inorg. Chem. 59, 11244 (2020).
  * (17) Honda, H., Basar, K., Siagian, S., Sakuma, T., Takahashi, H., Kawaji, H. and Atake, T. Low-temperature phase in superionic conductor Ag3SBrxI1-x. J. Phys. Soc. Jpn. 76, 114603 (2007).
  * (18) Shahrokhi, S., Dubajic, M., Dai, Z.-Z., Bhattacharyya, S., Mole, R. A., Rule, K. C., Bhadbhade, M., Tian, R., Mussakhanuly, N., Guan, X., Yin, Y., Nielsen, M. P., Hu, L., Lin, C.-H., Chang, S. L. Y., Wang, D., Kabakova, I. V., Conibeer, G., Bremner, S., Li, X.-Y., Cazorla, C. and Wu, T. Anomalous structural evolution and glassy lattice in mixed-halide hybrid perovskites. Small 18, 2200847 (2022).
  * (19) Wang, J., Gao, H., Han, Y., Ding, C., Pan, S., Wang, Y., Jia, Q., Wang, H.-T., Xing, D. and Sun, J. MAGUS: machine learning and graph theory assisted universal structure searcher. Nat. Sci. Rev. 10, nwad128 (2023).
  * (20) Ceperley, D. M. and Alder, B. J. Ground state of the electron gas by a stochastic method. Phys. Rev. Lett. 45, 566 (1980).
  * (21) Perdew, J. P., Burke, K. and Ernzerhof, M. Generalized gradient approximation made simple. Phys. Rev. Lett. 77, 3865 (1996).
  * (22) Perdew, J. P., Ruzsinszky, A., Csonka, G. I., Vydrov, O. A., Scuseria, G. E., Constantin, L. A., Zhou, X. and Burke, K. Restoring the density-gradient expansion for exchange in solids and surfaces. Phys. Rev. Lett. 100, 136406 (2008).
  * (23) Sun, J., Ruzsinszky, A. and Perdew, J. P. Strongly constrained and appropriately normed semilocal density functional. Phys. Rev. Lett. 115, 036402 (2015).
  * (24) Cazorla, C., D. Alfè and Gillan, M. J. Constraints on the phase diagram of molybdenum from first-principles free-energy calculations. Phys. Rev. B 85, 064113 (2012).
  * (25) Cazorla, C. and Errandonea, D. Superionicity and polymorphism in calcium fluoride at high pressure. Phys. Rev. Lett. 113, 235902 (2014).
  * (26) Stokes, H. T. and Hatch, D. M. FINDSYM: program for identifying the space-group symmetry of a crystal. J. Appl. Cryst. 38, 237 (2005).
  * (27) Cazorla, C. and Boronat, J. Simulation and understanding of atomic and molecular quantum crystals. Rev. Mod. Phys. 89, 035003 (2017).
  * (28) Cazorla, C., Errandonea, D. and Sola, E. High-pressure phases, vibrational properties, and electronic structure of Ne(He)2 and Ar(He)2: A first-principles study. Phys. Rev. B 80, 064105 (2009).
  * (29) Cazorla, C. and Rurali, R. Dynamical tuning of the thermal conductivity via magnetophononic effects. Phys. Rev. B 105, 104401 (2022).
  * (30) Ehsan, S., Arrigoni, M., Madsen, G. K. H., Blaha, P. and Tröster, A. First-principles self-consistent phonon approach to the study of the vibrational properties and structural phase transition of BaTiO3. Phys. Rev. B 103, 094108 (2022).
  * (31) Cazorla, C., Bichelmaier, S., Escorihuela-Sayalero, C., Íñiguez J., Carrete, J. and Rurali, R. Light-driven dynamical tuning of the thermal conductivity in ferroelectrics. Nanoscale 16, 8335 (2024).
  * (32) Carreras, A., Togo, A. and Tanaka, I. DynaPhoPy: A code for extracting phonon quasiparticles from molecular dynamics simulations. Comput. Phys. Commun. 221, 221 (2017).
  * (33) Kresse, G. and Furthmüller, J. Efficient iterative schemes for ab initio total-energy calculations using a plane-wave basis set. Phys. Rev. B 54, 11169 (1996).
  * (34) Blöchl, P. E. Projector augmented-wave method. Phys. Rev. B 50, 17953 (1994).
  * (35) Togo, A. and Tanaka, I. First principles phonon calculations in materials science. Scr. Mater 108, 1 (2015).
  * (36) Scheidgen, M., Himanen, L., Ladines, A. N. _et al._ NOMAD: A distributed web-based platform for managing materials science research data. J. Open Source Softw. 8, 5388 (2023).
  * (37) DOI:10.17172/NOMAD/2024.05.17-2